Document party attribute extraction method and system
Through the method of segmented processing of legal documents and comparing information, the problem of difficult to extract accurate and standardized parties in the prior art is solved, and higher extraction accuracy and standardization are achieved.
Patent Information
- Application Number
- CN202411754260.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-04-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, it is difficult to effectively extract accurate and standardized party attribute information when dealing with unstructured legal documents, especially when the degree of formatting is low or the text diversity is strong.
By treating the extracted text in segmentation according to the category of the parties, multiple text paragraphs are generated, each paragraph includes only one party. Then, multiple first target information related to the parties are extracted from each paragraph, and compared it with the preset data specifications, correct information that does not comply with the specifications, and finally output the party attribute value that complies with the specifications.
It improves the accuracy and standardization of the extraction of the parties' attributes, avoids attribute confusion and redundancy, and ensures the integrity and reliability of the data.
Smart Images

Figure CN119829773A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data extraction technology, and in particular to a method and system for extracting attributes of parties involved in a document. Background Art
[0002] With the development of information technology, a large number of legal documents and related text materials are stored in unstructured form. The party information contained in them is of great value for case analysis, data archiving and automated processing.
[0003] However, when processing these unstructured texts, existing technologies generally use methods based on keyword matching, simple rule filtering or predefined templates to extract the attributes of the parties. These methods rely on manually set rules and specific formats, and often cannot effectively extract accurate and standardized party attribute information for documents with low formatting or high text diversity.
[0004] Therefore, how to improve the accuracy and standardization of extracting the attributes of the parties has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides a method, system, electronic device and storage medium for extracting attributes of parties in a document, so as to solve the defects in the prior art and improve the accuracy and standardization of extracting attributes of parties.
[0006] The present invention provides a method for extracting attributes of a party to a document, comprising the following steps: Segmenting the extracted text according to the categories of the parties to generate a plurality of text paragraphs; each of the text paragraphs includes only one party; Extracting a plurality of first target information related to the party from each of the text paragraphs; each of the first target information corresponds to only one attribute of the party; Comparing each of the first target information with a preset data specification, and dividing all of the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; According to the preset correction method corresponding to each party attribute, each of the third target information is corrected to generate fourth target information that meets the preset data specification; Each of the second target information and each of the fourth target information are output as specific attribute values of the corresponding party attributes.
[0007] According to a document party attribute extraction method provided by the present invention, each of the first target information corresponds to only one first data type, and the first data type includes a text type; comparing each of the first target information with a preset data specification specifically includes: Extracting at least one actual text feature related to the attributes of the party from the first target information of each text type; When it is determined that any one of the actual text features is inconsistent with the expression form of the preset text feature specification, generating a comparison result that does not meet the preset data specification; When it is determined that all of the actual text features are consistent with the expression form of the preset text feature specification, a comparison result that meets the preset data specification is generated.
[0008] According to a document party attribute extraction method provided by the present invention, each of the first target information corresponds to only one first data type, and the first data type also includes a numerical type; the comparing each of the first target information with a preset data specification specifically includes: Extracting at least one actual numerical feature from the first target information of each numerical type; Determine the target number of numerical features corresponding to each of the first target information according to the preset number of numerical features corresponding to each party attribute; When it is determined that the number of the actual numerical features is inconsistent with the corresponding number of target numerical features, generating a comparison result that does not meet the preset data specification; When it is determined that the number of the actual numerical features is consistent with the corresponding number of target numerical features, a comparison result that meets the preset data specification is generated.
[0009] According to a document party attribute extraction method provided by the present invention, the step of extracting a plurality of first target information related to the party from each of the text paragraphs specifically includes: Extracting a plurality of initial information from each of the text paragraphs by at least one of regular expression evaluation, NLP entity classification, or dictionary value matching; According to a preset data screening method, a plurality of the first target information is screened out from all the initial information.
[0010] According to a method for extracting attributes of a party to a document provided by the present invention, the method further comprises: Each of the party attributes and the specific attribute values of each of the party attributes are encapsulated in a multi-layer structured manner and stored in JSON format.
[0011] According to a method for extracting attributes of a party in a document provided by the present invention, before segmenting the text to be extracted according to the categories of the parties to generate a plurality of text paragraphs, the method further includes: Acquire target data material from at least one data source; Determining a data extraction method corresponding to each of the target data materials according to the second data type corresponding to each of the target data materials, and extracting an initial text from each of the target data materials based on the data extraction method; The initial text is cleaned to remove garbled characters, irrelevant characters, irrelevant symbols and erroneous repeated characters, so as to generate the text to be extracted.
[0012] The present invention also provides a document party attribute extraction system, comprising the following modules: A text segmentation module, used for segmenting the extracted text according to the categories of the parties, to generate a plurality of text paragraphs; each of the text paragraphs includes only one party; A processing module, configured to extract a plurality of first target information related to the party concerned from each of the text paragraphs; each of the first target information corresponds to only one attribute of the party concerned; The processing module is further used to compare each of the first target information with a preset data specification, and divide all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; The processing module is further used to modify each of the third target information according to a preset modification method corresponding to each party attribute, so as to generate fourth target information that meets the preset data specification; An output module is used to output each of the second target information and each of the fourth target information as specific attribute values corresponding to the attributes of the party.
[0013] The present invention also provides an electronic 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 program, the method for extracting attributes of a party to a document as described above is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods for extracting attributes of parties to a document as described above.
[0015] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for extracting attributes of parties to a document.
[0016] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: By segmenting the text to be extracted according to the categories of the parties, multiple text paragraphs are generated, each of which includes only one party, thus achieving preliminary structural processing of the text, clarifying the correspondence between paragraphs and parties, and avoiding the problem of cross-confusion of information of multiple parties. This segmentation scheme lays a good foundation for subsequent information extraction, enabling the system to efficiently extract relevant data in a relatively independent semantic environment, improving the accuracy of processing.
[0017] By extracting multiple first target information related to the parties from each text paragraph and ensuring that each first target information corresponds to only one attribute of the parties, accurate extraction and classification of attribute information is achieved, avoiding redundancy and misjudgment problems caused by attribute confusion.
[0018] By comparing each first target information with the preset data specification, and dividing all the first target information into the second target information that meets the preset data specification and the third target information that does not meet the preset data specification according to the comparison results, the standardized data that meets the standard is effectively screened out, and the data that does not meet the standard is isolated, providing a clear target for subsequent corrections. By correcting each third target information according to the preset correction method corresponding to each party attribute, the fourth target information that meets the preset data specification is generated, so that the attribute information that is erroneous or inconsistent in the extraction process is effectively processed, ensuring the integrity and accuracy of the data. By outputting each second target information and each fourth target information as the specific attribute value of the corresponding party attribute, high-quality attribute data is finally presented. In summary, through the above scheme, the collaborative work of each step from text segmentation to attribute extraction, and then to standardized processing and output gradually realizes the complete transformation from unstructured text to standardized party attribute information, thereby effectively improving the accuracy and standardization of the extracted party attributes. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 This is one of the flow charts of the method for extracting attributes of parties to a document provided by the present invention.
[0021] Figure 2 This is the second flow chart of the method for extracting attributes of parties to a document provided by the present invention.
[0022] Figure 3This is the third flow chart of the method for extracting attributes of parties to a document provided by the present invention.
[0023] Figure 4 This is a schematic diagram of a multi-level package provided by the present invention.
[0024] Figure 5 It is a structural schematic diagram of the document party attribute extraction system provided by the present invention.
[0025] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] It should be noted that, in the description of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device 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 device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. The orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0028] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0029] Combine the following Figure 1-Figure 6 The invention describes the document party attribute extraction method, system, electronic device and storage medium provided by the present invention.
[0030] Figure 1 This is one of the flow charts of the document party attribute extraction method provided by the present invention, such as Figure 1 As shown, including but not limited to the following steps: Step 101: Segment the text to be extracted according to the categories of the parties to generate multiple text paragraphs; each text paragraph includes only one party.
[0031] In step 101, the text to be extracted is segmented according to the categories of the parties to generate multiple text paragraphs, each of which only includes information related to one party. This processing method is to deal with the complex and diverse text structure problems in legal documents. Legal documents usually contain information about multiple parties, which may be distributed in different forms. Directly extracting attributes will be interfered by the context, resulting in poor accuracy and consistency of the extraction results. Therefore, firstly segmenting the text content according to the categories of the parties can achieve preliminary structuring and lay the foundation for subsequent target information extraction and standardized processing.
[0032] In the text to be extracted, the category information of the parties is identified through keywords, and the text is segmented according to the litigation status (such as "plaintiff", "defendant" or "agent"). Each paragraph only retains information related to one party. Segmentation is achieved through automated scripts, combined with deep learning models to classify and match keywords, and ensure the contextual semantic integrity during paragraph segmentation to avoid information omission.
[0033] In a possible implementation manner, the text to be extracted is obtained by the following steps: Acquire target data material from at least one data source; Determining a data extraction method corresponding to each target data material according to the second data type corresponding to each target data material, and extracting initial text from each target data material based on the data extraction method; The initial text is cleaned to remove garbled characters, irrelevant characters, irrelevant symbols, and erroneous repeated characters to generate the text to be extracted.
[0034] In a specific implementation, the target data material is first obtained from at least one data source. The data source may be a paper document, a scanned image, or a less structured electronic document. These materials are regarded as raw input data and need to be subsequently processed according to their specific type. Then, by analyzing the second data type (such as image, PDF, or text file) corresponding to each target data material, the appropriate data extraction method is determined. For example, for image files, the OCR optical character recognition technology based on deep learning is used to convert the text content in the image into editable text; for electronic documents, their content can be directly parsed and relevant text can be extracted. This process combines automated data processing tools and adaptive extraction algorithms to efficiently deal with different types of data materials.
[0035] After the initial extraction is completed, the initial text is cleaned. This step is particularly critical because the initial text may contain confusing formatting, irrelevant characters, and other interfering information. The cleaning process uses a customized text cleaning algorithm, which includes operations such as removing garbled characters, removing irrelevant text and symbols, and eliminating repeated characters. At the same time, the cleaning algorithm handles the typesetting issues in the text to ensure that the generated text has a clear and coherent semantic structure. Finally, through this series of operations, the generated text to be extracted reaches a standardized state.
[0036] Step 102: extract multiple first target information related to the parties from each text paragraph; each first target information corresponds to only one party attribute.
[0037] In step 102, by extracting multiple first target information related to the parties from each text paragraph and ensuring that each first target information corresponds to only one party attribute, this process aims to achieve accurate extraction and clear classification of attribute information. In legal documents, party information is often scattered in different paragraphs and in various forms. Direct comprehensive extraction is likely to cause confusion and redundancy. Therefore, establishing a mapping relationship between text paragraphs and party attributes and combining it with a specific extraction method can effectively improve the accuracy and pertinence of information extraction.
[0038] In a possible implementation, step 102 specifically includes the following steps: Extracting multiple initial information from each text paragraph by at least one of regular expression evaluation, NLP entity classification, or dictionary value matching; According to a preset data screening method, a plurality of first target information is screened out from all the initial information.
[0039] In the specific implementation, multiple initial information is first extracted from the text paragraph by at least one of regular expression value extraction, NLP entity classification or dictionary value matching. Regular expressions are suitable for extracting information with fixed formats, such as ID card numbers, telephone numbers, etc., and structured data can be quickly obtained through pattern matching. NLP entity classification uses natural language processing technology to identify specific entity categories from text semantics, such as names, places, organizations, etc., and is suitable for processing text paragraphs with flexible content. Dictionary value matching verifies the initial extraction results based on a preset attribute dictionary to ensure that the extracted content meets the expected attribute range. The combination of the above three methods can take into account both regularity and semantic flexibility, and adapt to different forms of party attribute information.
[0040] Furthermore, according to the preset data screening method corresponding to each first data type, multiple first target information are screened out from all the initial information. The specific screening method includes anchor word detection, veto condition verification and content cleaning, aiming to optimize the quality of the initial information and provide high-quality input for subsequent steps.
[0041] Preset data screening methods include but are not limited to the following methods: Each initial information is contextually verified, and anchor words are searched forward or backward to ensure that the initial information has valid semantic relevance. For example, when extracting "ID number", forward or backward search is performed to see whether there is an anchor word "ID card" or "document number". If the specified anchor word is not found in the context before and after the initial information, the initial information is determined to be unqualified and filtered out. This context-based screening mechanism uses the specificity and semantic relevance of anchor words to effectively eliminate invalid or noisy data.
[0042] The initial information is verified through preset rejection conditions. The rejection conditions are set based on empirical rules and attribute types, such as prohibiting the appearance of special characters (such as "#" or "@"), excluding abnormal value ranges (such as negative numbers or oversized amounts), or filtering out erroneous information (such as incorrect date format). If the initial information meets these rejection conditions, it is considered invalid data and is removed from the result set. Veto condition verification can further enhance the accuracy of screening and prevent irrelevant or abnormal information from entering the subsequent process.
[0043] The initial information after screening is cleaned up to further optimize the data quality. Content cleaning includes removing redundant characters, correcting the format, and truncating useless parts. For example, for the extracted address information, repeated descriptive words are cleaned up; for numerical information, it is standardized into a unified numerical format. This process ensures the standardization of the first target information, making the result both accurate and in line with the expected format requirements.
[0044] Step 103: Compare each first target information with the preset data specification, and divide all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result.
[0045] In step 103, each first target information is compared with the preset data specification, and the first target information is classified into the second target information that meets the preset data specification and the third target information that does not meet the preset data specification according to the comparison result. The purpose of designing this step is to ensure the accuracy and consistency of the first target information by comparing it with the preset specification one by one, and to identify and isolate the information that does not meet the specification, so as to provide a clear basis for subsequent correction and output. Since the attribute information of the parties in the legal documents may have format differences or be incomplete, directly using the uncompared target information may lead to data errors or difficulties in use. Therefore, a standardized comparison process is essential.
[0046] In a possible implementation, when the first data type is a text type, refer to Figure 2 , Figure 2 This is the second flow chart of the method for extracting document party attributes provided by the present invention. Figure 2 As shown, step 103 specifically includes steps 201-203: Step 201: extract at least one actual text feature related to the attributes of the party concerned from the first target information of each text type.
[0047] In step 201, at least one actual text feature related to the party's attributes is extracted from the first target information of each text type, in order to provide a clear feature basis for subsequent standard comparison and ensure that the first target information can be classified through the standardization process. The text information in legal documents usually has a variety of expressions. For example, the party's name may contain a title word, and the gender information may be replaced by a symbol. These situations require the extraction of actual text features to remove interference information, laying a foundation for subsequent comparison and standardization processing.
[0048] In the specific implementation, the first target information of the text type is first parsed to identify the potential features in the text. For example, for the information of name attributes, there may be diverse expressions such as "Mr. Zhang San" and "Lawyer Li Si". Through parsing, the core name texts "Zhang San" and "Li Si" are extracted. The extraction process relies on regular expressions and NLP technology. The former quickly captures text features with specific formats through pattern matching, and the latter identifies key entities such as names and place names through semantic analysis. For gender information, if the extracted text feature is a symbol other than "male / female" (such as "M / F"), the system will translate it into standardized text "male" or "female" through dictionary value matching. In addition, for complex address information, the core parts are extracted through semantic segmentation technology, such as key elements such as provinces, cities, and districts, and redundant descriptive content is removed.
[0049] The extracted text features not only retain the core content of the information, but also ensure the semantic relevance of these contents to the attributes of the parties. For example, when processing multiple values during the extraction process, the system will give priority to the first valid feature that appears in the text, or the longest feature value, thereby enhancing the stability and consistency of the information. In addition, the system will also verify based on the anchor words in the context to ensure that the extracted features are indeed related to the target attributes. For example, the name information must be near the anchor words such as "plaintiff" and "defendant", and the gender information must be associated with the "gender" keyword.
[0050] Step 202: When it is determined that any actual text feature is inconsistent with the expression form of the preset text feature specification, a comparison result that does not meet the preset data specification is generated.
[0051] Step 203: When it is determined that all actual text features are consistent with the expression form of the preset text feature specification, a comparison result that meets the preset data specification is generated.
[0052] In steps 202 and 203, by comparing each actual text feature with the expression form of the preset text feature specification, comparison results that do not meet and meet the preset data specifications are generated respectively. These two steps are designed to strictly screen the extracted first target information to ensure that it meets the preset specifications, thereby laying the foundation for the accuracy and consistency of subsequent data. Since the text features in legal documents may deviate from the standard expression form due to writing style, format differences or human input errors, by comparing and classifying them item by item, the transmission of abnormal information can be effectively avoided and the reliability of the data processing process can be improved.
[0053] In the specific implementation, the actual extracted text features are first compared with the preset text feature specifications one by one. The preset specifications define the format rules that the text features should comply with based on the data type and semantic requirements. For example, the name must be a legal text without special characters, and the character length must be within a certain range; the gender field must be "male" or "female", and no other abbreviations or symbols can appear. The specific process of the comparison is divided into multiple steps: the first is format verification, in which the system checks the basic attributes of the extracted text features such as length and character type; the second is content matching, which verifies the matching of specific rules through regular expressions and other technologies, such as the number of digits and checksums in the ID card number; the third is semantic verification, such as cross-checking the extracted name with the known name library to verify the rationality.
[0054] In step 202, if any actual text feature fails the comparison, the system will generate a comparison result that does not meet the preset data specification and mark the corresponding first target information as the third target information. This processing method ensures that abnormal data will not enter the subsequent links.
[0055] In step 203, when all actual text features pass the comparison and meet the preset specifications, the system generates a comparison result that meets the preset data specifications and marks the corresponding first target information as the second target information. At this time, the target information is regarded as valid data and can directly enter the subsequent process. For example, if the extracted gender field is "male" and meets the format and semantic requirements of the preset specifications, the information is marked as the second target information and serves as the candidate data for the final output.
[0056] By combining the processing flow of steps 202 and 203, efficient screening and classification of the first target information is achieved. The effect of this is reflected in three aspects: first, by comparing one by one, the target information that does not meet the specifications is accurately identified, avoiding abnormal data from affecting the quality of subsequent processing; second, the target information that meets the specifications is directly marked as valid data, which greatly improves the efficiency of data circulation; finally, through refined comparison rules and dynamically adapted preset specifications, the system's adaptability to complex legal document scenarios is enhanced, ensuring the robustness and reliability of the entire technical solution. Finally, the linkage of these two steps provides a clear and definite data basis for subsequent corrections and outputs, and optimizes the integrity and rigor of the entire processing flow.
[0057] In another possible implementation, when the first data type is a numerical type, refer to Figure 3 , Figure 3 This is the third flow chart of the method for extracting document party attributes provided by the present invention. Figure 3 As shown, step 103 specifically also includes steps 301-304: Step 301: extract at least one actual numerical feature from the first target information of each numerical type.
[0058] In step 301, at least one actual numerical feature is extracted from the first target information of each numerical type, in order to provide accurate basic data for subsequent comparison and verification. The first target information of numerical type is commonly seen in key fields such as amount and ID number in legal documents, which are crucial to the integrity and accuracy of the attributes of the parties. However, due to input errors, format diversity or interference from additional redundant information, the extracted numerical features may be non-standard or lengthy. Therefore, by accurately extracting the actual numerical features, useless data can be stripped off to ensure the accuracy and applicability of the extracted content.
[0059] In the specific implementation, the system first parses the first target information of the numerical type to identify potential numerical features. For example, for the ID card number field, the system will extract an 18-digit or 15-digit sequence from the information through regular expression matching; for the amount field, the system will capture content with numbers and currency symbols from the text, such as "¥10,000.00" or "10000 yuan". This process combines rule matching and context analysis to ensure the extraction scope and semantic relevance of numerical features.
[0060] When extracting numerical features, the system will preprocess the extraction results to further optimize the extraction accuracy. For example, for the amount field, the system will remove the thousandth separator (such as ",") and unify the numerical unit; for the ID number, the system will remove the attached irrelevant characters or descriptive text; for the date, the system will parse and standardize it into a unified format. In addition, the extraction process is also combined with contextual verification to ensure that the extracted numerical features are consistent with the semantics of the specific party attributes.
[0061] Step 302: Determine the target number of numerical features corresponding to each first target information according to the preset number of numerical features corresponding to each party attribute.
[0062] In step 302, the number of target numerical features that the first target information of each numerical type needs to meet is determined based on the number of preset numerical features corresponding to each party attribute, in order to provide clear quantity specifications for comparison and verification. Numerical type information in legal documents, such as ID card numbers or amount fields, often has fixed quantity or structure requirements. If numerical features without clear verification quantity are directly used, the results may be biased. Therefore, this step ensures the consistency and accuracy of the numerical feature extraction process by clearly stipulating the number of target features.
[0063] In the specific implementation, the system first loads the preset numerical feature quantity specifications related to each party attribute. For example, for the ID card number attribute, the preset feature quantity is a single value and must be a 15-digit or 18-digit combination; for the amount field, the preset feature quantity may allow multiple values (such as multiple compensation amounts or multiple subject amounts), but must be limited to a reasonable range. The preset specifications are dynamically set according to the actual needs of the legal document and used as a verification basis in the system.
[0064] During the execution process, the system counts the actual extracted numerical features to verify whether their quantity matches the preset specifications. For example, when processing the ID card number, the system will detect whether there is only one value in the extraction result and the length of the value meets the requirement of 15 or 18 digits; when processing the amount field, the system will count the number of extraction results to ensure that it does not exceed the preset maximum value range. If there is redundant information in some numerical features that does not meet the quantity requirements, the system will record this information for subsequent processing and use the numerical features that meet the quantity specifications as the target of subsequent verification.
[0065] Step 303: When it is determined that the number of actual numerical features is inconsistent with the corresponding number of target numerical features, a comparison result that does not meet the preset data specification is generated.
[0066] Step 304: When it is determined that the number of actual numerical features is consistent with the corresponding number of target numerical features, a comparison result that meets the preset data specification is generated.
[0067] In steps 303 and 304, by determining whether the number of actual numerical features is consistent with the number of target numerical features, a comparison result that does not conform to the preset data specification or a comparison result that conforms to the preset data specification is generated respectively. These two steps are intended to ensure that the extracted numerical features not only meet the format requirements, but also strictly comply with the quantity specifications, thereby ensuring the integrity and accuracy of the data. Since the numerical information in legal documents often has clear quantity and structure requirements, such as the ID card number is a single value, and the amount may contain multiple values, but it must be limited to a reasonable range, directly using data that has not been verified in quantity may lead to erroneous processing. Therefore, consistency verification of the quantity is essential.
[0068] In the specific implementation, the system first loads the preset target number of numerical features related to the attributes of the parties, and counts the actual numerical features extracted one by one. In step 303, if the number of actual numerical features is inconsistent with the target number of numerical features, the system immediately generates a comparison result that does not meet the preset data specifications. For example, when processing the ID card number field, if the extraction result contains multiple values (such as accidental repeated extraction) or no value (such as extraction failure), the system will mark the information as non-compliant data; in the amount field, if the amount extracted exceeds the preset reasonable range, for example, there are too many irrelevant amount values, it is also considered non-compliant. This step effectively eliminates redundant information or abnormal data caused by extraction errors through quantity verification.
[0069] In step 304, if the number of actual numerical features is consistent with the number of target numerical features, the system further verifies whether its content and format meet the preset specifications, and generates a comparison result that meets the preset data specifications. For example, in the ID card number verification, when the number of extracted values is 1 and the format meets the requirements of 15 or 18 digits, the information is marked as the second target information that meets the specifications; for the amount field, when the number of extracted multiple amounts is consistent with the number of target features, and all amount values meet the numerical range and format specifications, the system also generates a comparison result that meets the specifications. This step ensures that the extraction results not only meet the quantity requirements, but also pass the strict verification of content and format.
[0070] Through steps 303 and 304, the system achieves accurate comparison and classification of the number of numerical features and the target specifications. The effect of this is reflected in three aspects: first, through clear quantity verification, invalid or erroneous data caused by abnormal quantity is eliminated, ensuring data quality from the source; second, data that meets the quantity specifications is further classified as information that meets the preset specifications, providing reliable input conditions for subsequent standardized output; third, the entire verification process is combined with dynamically adaptive rule design, so that the system can efficiently respond to the numerical attribute processing needs in diverse legal documents.
[0071] Step 104: According to the preset correction method corresponding to each party attribute, each third target information is corrected to generate fourth target information that meets the preset data specification.
[0072] In step 104, the third target information that does not conform to the preset data specification is corrected according to the preset correction method corresponding to each party attribute, and the fourth target information that conforms to the specification is generated. The design purpose of this process is to unify the data format, eliminate errors or inconsistencies, and provide high-quality input for subsequent data output. The party attribute information in legal documents often leads to inconsistent formats or missing content in the third target information due to writing habits or differences in expression. Therefore, it is particularly important to use flexible correction methods to standardize it.
[0073] In the specific implementation, the system processes the third target information one by one according to different attribute types and corresponding correction methods. The correction methods include the following: First, for certain party attribute information with fixed expressions, such as gender or date, the system directly uses the specified standard fixed constant expression for correction. For example, when the third target information of the gender field is "male" or "M", the system replaces it with the fixed expression "male" according to the preset specification; when the date format is "12-31-2023", the system uniformly corrects it to "2023-12-31". This correction method is fast and effective, and is suitable for attributes with clear standards.
[0074] Secondly, for the third target information that may extract multiple candidate values, the system will select the optimal value according to the rules. For example, by selecting the third target information that first appears in the text as the correction result, priority is given to retaining the first credible value in the document. For example, if "Mr. Zhang San" and "Zhang San" are extracted in the party's name field, the system gives priority to "Mr. Zhang San". Alternatively, according to the specific attribute type, the system can select the longest third target information as the standard value. For example, in the address field, if the extracted values are "Chaoyang District" and "Chaoyang District, Beijing", the system will retain the more complete "Chaoyang District, Beijing" as the final correction result.
[0075] For the third target information that needs further verification, the system completes the correction by matching the translation value of the third target information with the dictionary. For example, for occupational attribute information, if the extracted value is "IT industry", the system will translate it into the standardized expression "information technology industry" through dictionary lookup. This method ensures the semantic standardization and consistency of the data.
[0076] When there are multiple related fields in the third target information that need to be integrated, the system supports the correction strategy of merging multiple third target information. For example, in the amount field, if the extraction results are "100,000 yuan" and "5,000 yuan" respectively, the system will merge them into "105,000 yuan" according to the preset rules to avoid information loss. In addition, for third target information that has been confirmed to be wrong or invalid, the system will replace the third target information. If the extracted third target information is "none" or other invalid expressions, the system will extract information from other fields according to the association rules for replacement.
[0077] Step 105: Output each second target information and each fourth target information as specific attribute values corresponding to the attributes of the party.
[0078] In step 105, each second target information that meets the preset data specification and each corrected fourth target information are output as specific attribute values of the corresponding party attributes, with the purpose of converting the high-quality data that has been screened and corrected into structured results for subsequent storage and use. There are many types of party attribute information in legal documents. Only after strict comparison and standardization can the output attribute values be ensured to be complete, accurate and meet application requirements. Therefore, the design of this step is to organize the data into a standardized form that can be directly used.
[0079] In the specific implementation, the system first integrates the second target information and the fourth target information, which represent the information verified by the preset data specification and the corrected normalized information respectively. During the integration process, the system will ensure a one-to-one correspondence between the attributes of the data and the categories of the parties. For example, for the basic information of the parties (such as name, gender, ID number) and related information (such as legal person address, contact information), the system classifies them into different attribute fields to ensure that all attribute information of each party is completely and clearly stored in the corresponding structure.
[0080] In a possible implementation, after step 105, the method further includes the steps of: Each party attribute and the specific attribute value of each party attribute are encapsulated and stored in a multi-layer structured manner using the JSON format.
[0081] In this step, the attributes of the parties and their specific attribute values are encapsulated and stored in a multi-layered structure, with the goal of organizing the extracted and corrected high-quality data into an intuitive and scalable hierarchical structure for subsequent data use and processing. The party information in legal documents usually has multi-level associations, such as the basic attributes of the parties, agent information, and other relevant details. If directly stored as a flat structure, it is easy to cause information loss or semantic confusion. Therefore, the design of a hierarchical structure can better reflect the logical association between data and improve retrieval efficiency and readability.
[0082] In specific implementation, the system groups data according to the categories of parties, for example, classifying "plaintiff" and "defendant" into different categories of parties. For each party category, the system further organizes the corresponding party information and models the parties and their associated persons (such as agents) separately. For example, in the "plaintiff" category, the system extracts the basic attributes of the party, such as name, gender, and place of origin, and associates the name, gender, and work unit of its agent (such as a lawyer) with the plaintiff as an independent node. This multi-layered structured organization ensures the semantic clarity of the data.
[0083] When storing data, the system uses JSON format to encapsulate the party information in multiple levels. The data structure of each layer clearly reflects the subordinate relationship between the parties, agents and their attribute values. For example, "Party A" is divided into plaintiff Zhang San and his agent Li Si, and each contains their corresponding specific attribute values. "Party B" records the information of defendant Wang Wu separately. For specific information about using JSON format to encapsulate party information in multiple levels, please refer to Figure 4 , Figure 4 This is a schematic diagram of a multi-level package provided by the present invention.
[0084] During the encapsulation process, the system also checks the format and hierarchy of the attribute values to ensure that all data conforms to the preset specifications. For example, the integrity of each attribute value is ensured to avoid missing the agent's work unit or the party's place of origin. For multi-valued fields (such as multiple agents), the system stores the values in array form for subsequent expansion. Through this encapsulation and storage process, the system organizes the processed party attributes and their specific attribute values into a standardized, multi-level structure.
[0085] Reference Figure 5 , Figure 5 : is a schematic diagram of the structure of the document party attribute extraction system provided by the present invention, the system includes: A text segmentation module is used to segment the extracted text according to the categories of the parties to generate multiple text paragraphs; each text paragraph includes only one party; A processing module, used for extracting a plurality of first target information related to the parties from each text paragraph; each first target information corresponds to only one attribute of the parties; The processing module is further used to compare each first target information with a preset data specification, and divide all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; The processing module is further used to modify each third target information according to a preset modification method corresponding to each party attribute to generate fourth target information that meets the preset data specification; The output module is used to output each second target information and each fourth target information as specific attribute values corresponding to the attributes of the party concerned.
[0086] In a possible implementation manner, the processing module is further configured to: Extracting at least one actual text feature related to the attributes of the party from the first target information of each text type; When it is determined that any actual text feature is inconsistent with the expression form of the preset text feature specification, a comparison result that does not meet the preset data specification is generated; When it is determined that all actual text features are consistent with the expression form of the preset text feature specification, a comparison result that meets the preset data specification is generated.
[0087] In a possible implementation manner, the processing module is further configured to: Extracting at least one actual numerical feature from the first target information of each numerical type; Determine the target number of numerical features corresponding to each first target information according to the preset number of numerical features corresponding to each party attribute; When it is determined that the number of actual numerical features is inconsistent with the number of corresponding target numerical features, a comparison result that does not meet the preset data specification is generated; When it is determined that the number of actual numerical features is consistent with the corresponding number of target numerical features, a comparison result that meets the preset data specification is generated.
[0088] In a possible implementation manner, the processing module is further configured to: Extracting multiple initial information from each text paragraph by at least one of regular expression evaluation, NLP entity classification, or dictionary value matching; According to a preset data screening method, a plurality of first target information is screened out from all the initial information.
[0089] In a possible implementation, the system further includes a packaging and storage module for performing multi-layer structured packaging and storage of each party attribute and the specific attribute value of each party attribute in JSON format.
[0090] In a possible implementation, the text segmentation module is further used to: Acquire target data material from at least one data source; Determining a data extraction method corresponding to each target data material according to the second data type corresponding to each target data material, and extracting initial text from each target data material based on the data extraction method; The initial text is cleaned to remove garbled characters, irrelevant characters, irrelevant symbols, and erroneous repeated characters to generate the text to be extracted.
[0091] It should be noted that the document party attribute extraction system provided by the present invention can execute the document party attribute extraction method of any of the above-mentioned embodiments during specific operation, which will not be elaborated in this embodiment.
[0092] Figure 6 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 6 As shown, the electronic device may include: a processor 610 (processor), a communication interface 620 (CommunicationsInterface), a memory 630 (memory) and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the document party attribute extraction method, which includes: segmenting the text to be extracted according to the category of the party to generate multiple text paragraphs; each text paragraph only includes one party; extracting multiple first target information related to the party from each text paragraph; each first target information corresponds to only one party attribute; comparing each first target information with a preset data specification, and dividing all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; correcting each third target information according to the preset correction method corresponding to each party attribute to generate fourth target information that meets the preset data specification; outputting each second target information and each fourth target information as specific attribute values corresponding to the party attribute.
[0093] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0094] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the document party attribute extraction method provided by the above-mentioned embodiments, and the method includes: segmenting the text to be extracted according to the category of the party to generate multiple text paragraphs; each text paragraph only includes one party; extracting multiple first target information related to the party from each text paragraph; each first target information corresponds to only one party attribute; comparing each first target information with a preset data specification, and dividing all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; according to the preset correction method corresponding to each party attribute, correcting each third target information to generate fourth target information that meets the preset data specification; outputting each second target information and each fourth target information as specific attribute values corresponding to the party attribute.
[0095] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by the processor 610, is implemented to execute the document party attribute extraction method provided in the above-mentioned embodiments, the method comprising: segmenting the text to be extracted according to the category of the party to generate multiple text paragraphs; each text paragraph only includes one party; extracting multiple first target information related to the party from each text paragraph; each first target information corresponds to only one party attribute; comparing each first target information with a preset data specification, and dividing all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; correcting each third target information according to the preset correction method corresponding to each party attribute to generate fourth target information that meets the preset data specification; outputting each second target information and each fourth target information as specific attribute values corresponding to the party attribute.
[0096] The system embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0097] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, or of course by hardware. Based on such an understanding, the above technical solution can essentially or in other words be embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for extracting attributes of parties to a document, characterized in that: include: Segmenting the extracted text according to the categories of the parties to generate a plurality of text paragraphs; each of the text paragraphs includes only one party; Extracting a plurality of first target information related to the party from each of the text paragraphs; each of the first target information corresponds to only one attribute of the party; Comparing each of the first target information with a preset data specification, and dividing all of the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; According to the preset correction method corresponding to each party attribute, each of the third target information is corrected to generate fourth target information that meets the preset data specification; Each of the second target information and each of the fourth target information are output as specific attribute values of the corresponding party attributes.
2. The document party attribute extraction method according to claim 1 is characterized in that: Each of the first target information corresponds to only one first data type, and the first data type includes a text type; comparing each of the first target information with a preset data specification specifically includes: Extracting at least one actual text feature related to the attributes of the party from the first target information of each text type; When it is determined that any one of the actual text features is inconsistent with the expression form of the preset text feature specification, generating a comparison result that does not meet the preset data specification; When it is determined that all of the actual text features are consistent with the expression form of the preset text feature specification, a comparison result that meets the preset data specification is generated.
3. The document party attribute extraction method according to claim 1, characterized in that: Each of the first target information corresponds to only one first data type, and the first data type also includes a numerical type; comparing each of the first target information with a preset data specification specifically includes: Extracting at least one actual numerical feature from the first target information of each numerical type; Determine the target number of numerical features corresponding to each of the first target information according to the preset number of numerical features corresponding to each party attribute; When it is determined that the number of the actual numerical features is inconsistent with the corresponding number of target numerical features, generating a comparison result that does not meet the preset data specification; When it is determined that the number of the actual numerical features is consistent with the corresponding number of target numerical features, a comparison result that meets the preset data specification is generated.
4. The document party attribute extraction method according to claim 1, characterized in that: The step of extracting a plurality of first target information related to the party concerned from each of the text paragraphs specifically includes: Extracting a plurality of initial information from each of the text paragraphs by at least one of regular expression evaluation, NLP entity classification, or dictionary value matching; According to a preset data screening method, a plurality of the first target information is screened out from all the initial information.
5. The document party attribute extraction method according to claim 1, characterized in that: The method further comprises: Each of the party attributes and the specific attribute values of each of the party attributes are encapsulated in a multi-layer structured manner and stored in JSON format.
6. The document party attribute extraction method according to claim 1, characterized in that: Before segmenting the extracted text according to the categories of the parties to generate a plurality of text paragraphs, the method further includes: Acquire target data material from at least one data source; Determining a data extraction method corresponding to each of the target data materials according to the second data type corresponding to each of the target data materials, and extracting an initial text from each of the target data materials based on the data extraction method; The initial text is cleaned to remove garbled characters, irrelevant characters, irrelevant symbols and erroneous repeated characters, so as to generate the text to be extracted.
7. A document party attribute extraction system, characterized in that: include: A text segmentation module, used for segmenting the extracted text according to the categories of the parties, to generate a plurality of text paragraphs; each of the text paragraphs includes only one party; A processing module, configured to extract a plurality of first target information related to the party concerned from each of the text paragraphs; each of the first target information corresponds to only one attribute of the party concerned; The processing module is further used to compare each of the first target information with a preset data specification, and divide all the first target information into second target information that meets the preset data specification and third target information that does not meet the preset data specification according to the comparison result; The processing module is further used to modify each of the third target information according to a preset modification method corresponding to each party attribute, so as to generate fourth target information that meets the preset data specification; An output module is used to output each of the second target information and each of the fourth target information as specific attribute values corresponding to the attributes of the party.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, it implements the document party attribute extraction method as described in any one of claims 1-6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the document party attribute extraction method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the document party attribute extraction method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method and system for automatically correcting text information
CN110162756A
Electronic medical record document data processing method and device and computer readable storage medium
CN112420145A
Structured processing method and device for legal documents
CN116152019A
Method and device for extracting information
CN117688141A
Cited By
Method and device for extracting structured information from text
CN120336530A