A large model-based nested field intelligent extraction and reconstruction method
By employing hierarchical modeling and dynamic routing mechanisms, the stability and accuracy issues of large models when processing complex nested fields are resolved, enabling efficient extraction and reconstruction of nested fields, which is suitable for rapid iteration scenarios in financial business.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 浙江泰隆商业银行股份有限公司
- Filing Date
- 2026-04-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing field extraction methods based on large models struggle to guarantee the stability and accuracy of output results when dealing with complex structures involving multi-level nesting and conditional dependencies. This is especially true in scenarios of rapid iteration in financial business, where traditional methods suffer from problems such as logical illusions, hierarchical misalignment, or field omissions.
By employing hierarchical modeling, conditional judgment, and dynamic routing mechanisms, the schema is dynamically generated by identifying the field structure and dependencies in the target business form, enabling accurate extraction and reconstruction of nested fields, including field existence judgment, multi-route extraction, and structure reconstruction.
It achieves stable extraction and highly reliable reconstruction of complex nested fields, avoids field redundancy and logical conflicts, improves the accuracy and stability of extraction, adapts to multi-level scenario requirements, reduces resource consumption, and is suitable for rapid iteration of financial business.
Smart Images

Figure CN122113919A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of field extraction and reconstruction, and particularly relates to a method for intelligent extraction and reconstruction of nested fields based on a large model. Background Technology
[0002] Before the widespread application of large-scale modeling technology, fields such as finance and healthcare primarily relied on rule-based methods and traditional machine learning methods for field extraction. Rule-based methods extracted fields by manually writing regular expressions, keyword matching rules, and fixed sentence templates. Traditional machine learning methods transformed the field extraction task into a sequence labeling task, training models on large-scale labeled data to learn the correspondence between text features and field labels, thereby achieving field extraction. However, these traditional methods have significant limitations: the former relies excessively on human experience, resulting in a large workload for rule writing and high maintenance costs, and poor adaptability to financial texts with flexible sentence structures and diverse expressions; the latter has stringent requirements for the quantity and quality of labeled data, requiring extensive re-labeling work when migrating across business scenarios, making it difficult to meet the needs of rapid iteration in financial businesses.
[0003] With the development of large model technology, field extraction methods based on large models have become a mainstream research direction. Currently proposed large model field extraction methods mainly include those based on few-sample prompts, such as one-time extraction based on static schemas. This method treats the target structure as part of the prompt words, requiring the large model to directly extract and fill all specified fields from the original text. This works reasonably well in scenarios with simple field structures, but when business forms contain complex structures with multiple nested layers and conditional dependencies, such as "existing cooperation with other banks → existing loans → quota list, list of cooperating bank names, guarantee method," the large model struggles to strictly adhere to its complex business logic constraints during a single generation. This easily leads to logical illusions (e.g., generating child fields when parent fields do not exist), hierarchical misalignment, or field omissions. Even with the introduction of structured output or secure grammars, only the correctness of a single-layer structure can be guaranteed, making it difficult to ensure the stability of multi-layer structures under dynamic conditions, resulting in unreliable output results. Summary of the Invention
[0004] The purpose of this invention is to propose a method for intelligent extraction and reconstruction of nested fields based on a large model to address the problems existing in the prior art. This method achieves accurate extraction of complex nested fields by introducing hierarchical modeling, conditional judgment and dynamic routing mechanisms.
[0005] To achieve the above objectives, the present invention adopts the following technical solutions:
[0006] A method for intelligent extraction and reconstruction of nested fields based on a large model, the method comprising:
[0007] S1. Field Structure and Dependency Modeling: Identify the fields in the target business form and define their types, whereby the field types include at least nested fields;
[0008] Establish a hierarchical structure model with at least two levels for the nested fields to define the hierarchical dependencies between the levels;
[0009] S2. Field Existence Determination: Based on the modeling results of step S1, the existence of the specified field in the target data is determined using the large model;
[0010] S3. Condition-triggered dynamic schema generation: Based on the existence judgment result described in step S2, dynamically generate the schema required for the next level of the specified field; wherein, if the specified field is judged to be non-existent, no schema for any of its next level fields is generated; if the specified field is judged to be existent, an existence judgment schema or content extraction schema is generated for its next level fields.
[0011] If the next-level field type is a nested field, an existence judgment schema is generated for it, and steps S2 and S3 are executed for the next-level field; otherwise, a content extraction schema is generated.
[0012] S4. Multi-route field extraction: Based on the content extraction schema generated in step S3, generate extraction prompts that correspond to the field types and contain field hierarchical paths. Based on the extraction prompts, call the large model to extract content from the target data and obtain a flattened correspondence between field hierarchical paths and extracted values.
[0013] S5. Reconstruction of Extracted Results: Reconstruct the flattened extracted results into structured data corresponding to the target business form according to the nested hierarchy;
[0014] For field-level paths that are determined to be non-existent or not extracted, fill them with predefined null values.
[0015] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, in step S2, the specified field is the first-level nested field that serves as the starting point for extraction, or it is in an intermediate level and its upper level is determined to be a nested field.
[0016] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, in step S2, an existence judgment schema is generated for the first-level nested fields.
[0017] The existence determination schema is generated by combining the names and descriptions of the corresponding nested fields with a binary existence determination instruction template called from the template library;
[0018] In step S2, based on the task type being existence judgment, the corresponding binary classification prompt word template is selected, and the parameters of Schema are filled into the binary classification prompt word template to generate the corresponding binary classification judgment prompt words;
[0019] The binary classification prompts and target data are input into the large model, which then outputs a judgment result indicating whether the corresponding nested fields exist or not.
[0020] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, in step S3, the content extraction schema is generated by combining the content extraction instruction template called from the template library with the field hierarchy path, field type and the strategy rules corresponding to the field type.
[0021] The field hierarchy path is obtained based on the hierarchy dependency relationship defined in step S1.
[0022] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, in step S4, the corresponding content extraction prompt word template is selected for content extraction according to the task type, and the parameters of the Schema are filled into the content extraction prompt word template to generate the corresponding extraction prompt word containing the field hierarchy path.
[0023] The extracted prompts and target data are input into the large model, which then outputs the values corresponding to the field hierarchy paths or results representing null values.
[0024] In the aforementioned intelligent extraction and reconstruction system for nested fields based on a large model, step S5 specifically includes:
[0025] Parse the field hierarchy path in the extracted results and identify the hierarchy identifier in the path;
[0026] Create or locate the corresponding nodes from top to bottom according to the hierarchical identifier;
[0027] Fill the extracted values into the corresponding end nodes;
[0028] Based on the judgment result of step S2, fill the non-existent branch nodes with null values.
[0029] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, in step S3, when the nested field of the previous level is determined to be non-existent, no schema of any of its next level fields is generated, and all its subfields are determined to be non-existent, including direct subfields and indirect subfields.
[0030] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, the field types also include atomic fields, enumerated fields, and list fields;
[0031] In step S4,
[0032] For atomic fields, an extraction strategy that returns a single atomic value is adopted;
[0033] For enumerated fields, an extraction strategy is adopted that selects from a preset list of available values;
[0034] For list fields, an extraction strategy is adopted that returns homogeneous elements and constructs a standard array.
[0035] A nested field intelligent extraction and reconstruction system based on a large model includes:
[0036] The modeling module is used to perform the field structure and dependency modeling in step S1;
[0037] The judgment module is used to perform the field existence judgment in step S2;
[0038] The dynamic generation module is used to perform the condition-triggered dynamic schema generation in step S3;
[0039] The route extraction module is used to perform the multi-route field extraction in step S4.
[0040] The reconstruction module is used to perform structural reconstruction of the extraction results in step S5;
[0041] The processor is configured to perform the functions of the modeling module, the judgment module, the dynamic generation module, the route extraction module, and the reconstruction module.
[0042] The memory stores instructions that can be executed by the processor, as well as a predefined template library and rule library.
[0043] In the above-mentioned intelligent extraction and reconstruction system of nested fields based on large models, the template library includes a schema template library and a prompt word template library;
[0044] The schema template library includes binary existence judgment instruction templates and content extraction instruction templates;
[0045] The prompt word template library includes binary prompt word templates and content extraction prompt word templates, and the binary existence judgment instruction template and content extraction instruction template correspond to the binary prompt word template and content extraction prompt word template, respectively.
[0046] The rule base mentioned above includes a policy rule base;
[0047] The policy rule base stores extraction policy rules corresponding to different field types. The routing extraction module extracts the field types in the schema based on the content, queries the policy rule base to determine and execute the corresponding extraction policy rules.
[0048] The advantages of this invention are: Based on generating structured data using a large model, this solution introduces field existence judgment, dependency link modeling and dynamic schema routing mechanism, realizing on-demand extraction and condition-triggered processing of multi-layer nested fields, overcoming the problems of easy field redundancy, logical conflict or complete extraction error that exist in the current generation of structured data using a large model.
[0049] By using hierarchical constraints on nested fields, the system automatically determines field accessibility, ensuring that the extraction process is strictly consistent with business semantics. This avoids invalid extraction, reduces resource consumption, and is adaptable to multi-level and multi-field scenarios. Furthermore, by combining field type characteristics, a differentiated multi-path extraction strategy is adopted, which significantly improves the accuracy and stability of the extraction.
[0050] Furthermore, based on the above extraction method, a flat extraction including paths can be achieved, and then automatic nested structure reconstruction can be achieved based on path parsing, which can effectively avoid problems such as missing fields, format disorder, and type conflict that are easy to occur when generating complex JSON structures at once.
[0051] Overall, this invention has significant advantages in processing complex hierarchical fields, enabling stable and accurate structured extraction using large models without additional training data. Moreover, the extraction and reconstruction results are significantly better than current static schema combined with secure grammar constraint generation methods. Attached Figure Description
[0052] Figure 1 This is a flowchart illustrating the method for intelligent extraction and reconstruction of nested fields based on a large model, as described in an embodiment of the present invention.
[0053] Figure 2 This is a flowchart of the structural reconstruction process in the nested field intelligent extraction and reconstruction method based on a large model according to an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram illustrating the nested field modeling and dynamic extraction path for cooperation with other banks in the credit application form example of this invention.
[0055] Figure 4 This is a schematic diagram of the system architecture of the nested field intelligent extraction and reconstruction system based on a large model, according to an embodiment of the present invention. Detailed Implementation
[0056] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. This embodiment primarily uses bank credit review as an application scenario, aiming to explain the invention rather than limiting its scope of protection. Those skilled in the art, after reading this specification, can make various modifications or alterations based on the inventive concept, but these equivalent forms also fall within the scope of protection defined by the present invention.
[0057] This solution provides a method for intelligent extraction and reconstruction of nested fields based on a large model. It aims to solve the problem of automatically and accurately extracting fields with complex nesting and conditional dependencies from unstructured or semi-structured target data, such as due diligence reports and contract texts, and reconstructing them into structured data (such as JSON format) that can be directly used by business systems.
[0058] like Figure 1 As shown, this method achieves stable extraction of complex-level fields and highly reliable form backfilling through field structure and dependency modeling, field existence determination, condition-triggered dynamic schema generation, multi-route extraction and selection, and automated nested structure reconstruction. It mainly includes several parts: field structure and dependency modeling, field existence determination, condition-triggered dynamic schema generation, multi-route field extraction, and structure reconstruction of the extraction results. The specific implementation method is as follows:
[0059] S1. Field Structure and Dependency Modeling
[0060] This step is fundamental to all subsequent intelligent decisions. Its purpose is to identify fields in the target business form and transform nested fields into a hierarchical structure model that is understandable and processable by machines, according to their nesting logic within the target business form. This process includes:
[0061] The system parses the target business form and identifies the field types. A business form is a configuration file containing a series of fields. For each type of business form, the relevant technical personnel pre-define the field types. When put into use, the system parses the field types of each field in the target business form based on the pre-definement information. In this embodiment, the field types include the following:
[0062] Nested fields: Fields that contain subfields. For example, "Cooperation with other banks" is a field that contains substructures such as loans and deposits. Its subfields can also be nested fields, atomic fields, enumeration fields, or list fields.
[0063] Atomic fields: Indivisible basic data units, such as customer names or registered capital.
[0064] Enumerated fields: Fields whose values come from a predefined list of optional values, such as the guarantee method, which may be one of mortgage, pledge, guarantee, or credit.
[0065] List fields: Arrays of multiple atomic values of the same type, such as a list of co-row names.
[0066] For nested fields, a hierarchical structure model is further constructed based on their nesting relationship with their child fields. This hierarchical structure model defines the hierarchical dependency relationship between fields at each level, that is, a field at a higher level contains one or more fields at a lower level, and the existence of the lower-level field is predicated on the existence of the higher-level field. For example... Figure 3 As shown, "Loan" and "Deposit" are the next level fields of "Other Bank Cooperation Status"; "Credit Limit List" and "Guarantee Method" are the next level fields of "Loan". The final output is a structured model that records the type and path of each field, such as "Other Bank Cooperation Status - Loan - Credit Limit List" (list field). Here, "Other Bank Cooperation Status" and "Loan" are nested fields; "Loan" is a subfield of "Other Bank Cooperation Status", and "Credit Limit List" is a list field, which is a subfield of "Loan".
[0067] S2. Field Existence Check
[0068] This step implements the decision logic of conditional triggering and on-demand extraction, and uses the semantic understanding capabilities of the large model to determine whether a certain nested field is actually mentioned in the current target data.
[0069] It is important to note that this article mentions two target files: the target business form and the target data. These are two different concepts, and to avoid confusion, they will be explained separately:
[0070] The target data is the source of information extraction. It is unstructured or semi-structured text, such as due diligence reports and contract texts. The system extracts field information from it.
[0071] The target business form is the target structure for information extraction. It is a predefined field template (such as a credit application form) that defines the fields to be extracted. It contains nested relationships. The system will reconstruct the data extracted from the target information into structured data, such as JSON, according to the structure of the target business form. Figure 1 Fields that require existence checks fall into two categories:
[0072] The first-level nested field that serves as the starting point for the entire extraction process, such as "cooperation status with other banks";
[0073] If the existence of the parent-level field has been determined, when the existence of the nested field in the middle level, such as "cooperation status with other banks", is determined, it is necessary to determine whether the existence of its subfield "loan" is present.
[0074] The system calls a pre-defined binary existence check instruction template from the schema template library. This template is then combined with parameters such as the name and description of the field for which the existence check needs to be performed to generate the corresponding field's existence check schema. This schema defines the task type as checking whether the corresponding field exists.
[0075] Based on the existence determination of this task type, select the corresponding binary prompt word template from the prompt word template library. Fill the template with the parameters from the previous Schema step to generate the final natural language prompt words to be sent to the large model, for example: Please determine whether the following text mentions "cooperation with other parties"? Only answer "yes" or "no".
[0076] The generated prompt words and target data text are input into the large model. After analyzing the text, the large model outputs a binary classification result of "yes" or "no", which will be used as the basis for the next decision.
[0077] The key to this step is to perform an existence check before extraction, so that the system will only consider the subfields or specific values under the nested field if it confirms that a certain nested field exists.
[0078] S3. Condition-triggered dynamic schema generation
[0079] This step dynamically determines the schema required for the next step based on the judgment result of step S2.
[0080] If a nested field is determined to be non-existent, the entire branch with that field as its parent node is terminated. For example, if the determination result for "Cooperation with other banks" is non-existent, the branch is terminated, and subsequent checks on the existence of loans and deposits, as well as subsequent content extraction, are no longer performed. The system does not generate a schema for any subfields under this field, and all its subfields are logically considered non-existent, avoiding any invalid subsequent operations and problems such as invalid fields being filled or field order being disordered.
[0081] If the preceding field is determined to exist, a schema is generated for its next-level field. At this point, further decisions need to be made based on the type of the next-level field:
[0082] If the next level field is still a nested field, an existence check schema is generated for it, and the process jumps back to step S2 to check the existence of the field, forming a loop of nested fields. This realizes the exploration of deep nested structures layer by layer, ensuring the order of field extraction and avoiding the problem of field omission.
[0083] If the next layer field is an atomic, enumerated, or list field, generate a content extraction schema for it. At this point, we have reached the bottom-level node from which specific information needs to be extracted, and the next step will be to perform the extraction action.
[0084] The content extraction schema generation process involves: calling the content extraction instruction template corresponding to the field type from the schema template library; combining the current field's hierarchical path, field type, and the extraction strategy corresponding to that field type retrieved from the policy rule library; and assembling a specific content extraction schema.
[0085] S4. Multi-route field extraction
[0086] This step is used to perform specific content extraction. It receives the content extraction schema generated in step S3 and uses appropriate strategies to call the large model for adaptive extraction based on the characteristics of different field types, as detailed below:
[0087] Based on the task type "content extraction" and the specific field types in the schema, select the corresponding content extraction prompt template from the prompt template library. Fill the template with parameters defined in the schema, such as paths and constraint rules (e.g., value range, units), to form the final extraction prompt. For example: Extract all "loan amounts from other banks" from the text and output them as a JSON array.
[0088] Input the prompt word and target data into the large model to obtain the extracted value corresponding to the hierarchical path of that field.
[0089] Furthermore, this solution proposes differentiated extraction strategies for different field types. These strategy rules are defined in a strategy rule base, and some of the rules are described below:
[0090] Atomic fields: return a single value, such as a piece of text or a number.
[0091] Enumerated fields: Restrict large models to select only from a predefined list of available values to ensure output compliance.
[0092] List field: Requires large models to return elements of the same type and construct a standard array.
[0093] Through the aforementioned multi-path routing mechanism, extraction instructions are automatically adapted for each field, significantly improving the accuracy and format stability of structured extraction tasks. It can stably generate field structures that conform to business logic and structural constraints under dynamic conditions.
[0094] Ultimately, the output is presented in a flat "field hierarchy path: extracted value" correspondence, with second-level fields under the same field generally having the same value type. For example, "Other Bank Cooperation Status - Loan - Credit Limit List": [5 million, 3 million], "Other Bank Cooperation Status - Loan - Guarantee Method": "[Mortgage, Mortgage]", both values are lists. Furthermore, each value in a list field can be an enumeration or an atomic field with a predefined data type.
[0095] S5. Structural Reconstruction of Extracted Results
[0096] This step involves reassembling the scattered, flattened extraction results back into the complex nested structure required by the business logic, such as... Figure 2 As shown:
[0097] Read the field hierarchy path in each flattened extraction result, such as "Other Bank Cooperation Status - Loans - Credit Limit List", and identify the hierarchy identifiers: Other Bank Cooperation Status, Loans, Credit Limit List;
[0098] Create or locate the corresponding JSON nodes from top to bottom according to the hierarchical identifier. For nested fields in the path, create JSON object nodes. For terminal fields, create corresponding data nodes according to their field type, such as arrays for list fields and values for atomic fields.
[0099] The extracted values are filled into the corresponding end nodes. In the example above, the extracted quota list is filled into this end node. Simultaneously, based on the existence judgment results recorded in step S2, predefined null values, such as null, are uniformly filled into those branch nodes that are judged not to exist. For example, if the deposit is judged not to exist, the deposit field will be directly set to null in the reconstructed JSON structure, and the deposit amount field below it will not appear.
[0100] like Figure 3 As shown in the example, this embodiment further illustrates the solution by extracting the necessary fields from a credit application form based on a corporate credit investigation report:
[0101] Taking the "Cooperation with Other Banks" business category as an example, suppose the form for this business category in the credit application form is as follows:
[0102]
[0103] First, the credit application form was analyzed to identify the nested field "Cooperation with Other Banks," which contains nested subfields "Loan" and "Deposit." Under "Loan" are the list field "Credit Limit List" and the enumerated field "Guarantee Method," and under "Deposit" is the atomic field "Deposit Amount."
[0104] Next, it determines whether "cooperation with other banks" exists, generates a prompt to query the big model, and the big model analyzes the full text of the enterprise credit investigation report and returns "exists".
[0105] Since the "Cooperation with Other Banks" field exists and its subfield "Loan" is a nested type, an existence judgment schema is generated for "Loan" and the process jumps back to step S2 to determine whether "Loan" exists. The same applies to "Deposit".
[0106] If "Loan" exists, its next-level fields, "Credit Limit List" and "Guarantee Method," are both non-nested fields, and content extraction schemas are generated for them separately. If "Loan" does not exist, no schema for any loan subfields is generated.
[0107] Similarly, if "Deposit" exists, its next level "Deposit Amount" is a non-nested field, and a content extraction schema is generated for it. If "Deposit" does not exist, no schema for any deposit subfield is generated.
[0108] Assuming "Loans" exist, corresponding prompts are generated based on the schemas of "Credit Limit List" and "Guarantee Method" to invoke the larger model, ultimately resulting in a flattened structure: Other Bank Cooperation Status - Loans - Credit Limit List: [5 million, 3 million]; Other Bank Cooperation Status - Loans - Guarantee Method: [Mortgage, Mortgage]. Simultaneously, assuming "Deposits" do not exist, no extraction is performed on this branch.
[0109] Finally, the extracted results are reconstructed, the paths in the flattened results are parsed, a nested structure is created, and [5 million, 3 million] and "[mortgage, mortgage]" are filled into the corresponding positions under the "Loan" object. Under the "Other Bank Cooperation Status" object, the "Deposit" field is set to null. The final output is the neat JSON shown below:
[0110] Cooperation with other banks: {
[0111] loan:{
[0112] Credit limit list: [5 million, 3 million]
[0113] Guarantee method: [Mortgage, Mortgage]
[0114] },
[0115] Deposits: null
[0116] }
[0117] The above example uses the business class "cooperation with other banks". When it is put into use, it is not limited to this business class. Multiple business classes with nested fields can be processed simultaneously or sequentially. There is no restriction here.
[0118] After the above modeling, existence judgment, dynamic schema generation, multi-path routing field extraction and reconstruction, a complete nested JSON object that conforms to the original business form structure is finally generated. It can be directly used for database entry, API interface transmission or form backfilling, realizing end-to-end automation from unstructured documents to structured business data.
[0119] Furthermore, such as Figure 4As shown, this embodiment also provides an architecture for a large-model-based intelligent field extraction and reconstruction system for implementing the above method. The system includes:
[0120] Processor: The core of the system's computation and control, configured to execute various functional modules to implement the above methods;
[0121] Memory: Stores program instructions that can be executed by the processor, as well as databases such as predefined template libraries and rule bases;
[0122] Functional modules: A series of logical modules implemented by the processor executing instructions from memory, including:
[0123] The modeling module is used to perform the field structure and dependency modeling in step S1;
[0124] The judgment module is used to determine the existence of fields in step S2;
[0125] The dynamic generation module is used to perform the condition-triggered dynamic schema generation in step S3;
[0126] The route extraction module is used to perform the multi-route field extraction in step S4.
[0127] The reconstruction module is used to perform structural reconstruction of the extraction results of step S5.
[0128] Specifically, the template library includes a schema template library and a prompt word template library, which are linked by task type.
[0129] The schema template library includes binary existence check instruction templates and content extraction instruction templates. The prompt word template library includes binary prompt word templates and content extraction prompt word templates. Furthermore, the binary existence check instruction templates and content extraction instruction templates correspond to the binary prompt word templates and content extraction prompt word templates, respectively.
[0130] The rule base includes a policy rule base, which stores extraction policy rules corresponding to different field types. The routing extraction module extracts the field types in the schema based on the content, queries the policy rule base to determine and execute the corresponding policy rules.
[0131] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined herein.
Claims
1. A method for intelligent extraction and reconstruction of nested fields based on a large model, characterized in that, The method includes: S1. Field Structure and Dependency Modeling: Identify the fields in the target business form and define their types. Field types should include at least nested fields. Establish a hierarchical structure model with at least two levels for the nested fields to define the hierarchical dependencies between the levels; S2. Field Existence Determination: Based on the modeling results of step S1, the existence of the specified field in the target data is determined using the large model; S3. Condition-triggered dynamic schema generation: Based on the existence judgment result described in step S2, dynamically generate the schema required for the next level of the specified field; wherein, if the specified field is judged to be non-existent, no schema for any of its next level fields is generated; if the specified field is judged to be existent, an existence judgment schema or content extraction schema is generated for its next level fields. If the next-level field type is a nested field, an existence judgment schema is generated for it, and steps S2 and S3 are executed for the next-level field; otherwise, a content extraction schema is generated. S4. Multi-route field extraction: Based on the content extraction schema generated in step S3, generate extraction prompts that correspond to the field types and contain field hierarchical paths. Based on the extraction prompts, call the large model to extract content from the target data and obtain a flattened correspondence between field hierarchical paths and extracted values. S5. Reconstruction of Extracted Results: Reconstruct the flattened extracted results into structured data corresponding to the target business form according to the nested hierarchy; For field-level paths that are determined to be non-existent or not extracted, fill them with predefined null values.
2. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 1, characterized in that, In step S2, the specified field is either the first-level nested field that serves as the starting point for extraction, or a nested field that is in the middle level and whose upper level is determined to exist.
3. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 2, characterized in that, In step S2, an existence determination schema is generated for the first-level nested fields; The existence determination schema is generated by combining the names and descriptions of the corresponding nested fields with a binary existence determination instruction template called from the template library; In step S2, based on the existence judgment task, the corresponding binary classification prompt word template is selected, and the parameters of the Schema are filled into the binary classification prompt word template to generate the corresponding binary classification judgment prompt word; The binary classification prompts and target data are input into the large model, which then outputs a judgment result indicating whether the corresponding nested fields exist or not.
4. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 3, characterized in that, In step S3, the content extraction schema is generated by combining the content extraction instruction template called from the template library with the field hierarchy path, field type and the strategy rules corresponding to the field type; The field hierarchy path is obtained based on the hierarchy dependency relationship defined in step S1.
5. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 4, characterized in that, In step S4, based on the content extraction task, the corresponding content extraction prompt word template is selected, and the parameters of the Schema are filled into the content extraction prompt word template to generate the corresponding extraction prompt words containing the field hierarchy path; The extracted prompts and target data are input into the large model, which then outputs the values corresponding to the field hierarchy paths or results representing null values.
6. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 5, characterized in that, Step S5 specifically includes: Parse the field hierarchy path in the extracted results and identify the hierarchy identifier in the path; Create or locate the corresponding nodes from top to bottom according to the hierarchical identifier; Fill the extracted values into the corresponding end nodes; Based on the judgment result of step S2, fill the non-existent branch nodes with null values.
7. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 1, characterized in that, In step S3, when a nested field at the next higher level is determined to be non-existent, no schema for any of its next-level fields is generated, and all its subfields are determined to be non-existent.
8. The method for intelligent extraction and reconstruction of nested fields based on a large model according to claim 1, characterized in that, The field types also include atomic fields, enumeration fields, and list fields; In step S4, For atomic fields, an extraction strategy that returns a single atomic value is adopted; For enumerated fields, an extraction strategy is adopted that selects from a preset list of available values; For list fields, an extraction strategy is adopted that returns homogeneous elements and constructs a standard array.
9. A nested field intelligent extraction and reconstruction system based on a large model, characterized in that, include: The modeling module is used to perform field structure and dependency modeling as described in step S1 of claim 1; The judgment module is used to perform the field existence judgment in step S2 as described in claim 1; The dynamic generation module is used to perform the condition-triggered dynamic schema generation in step S3 as described in claim 1; A route extraction module is used to perform multi-route field extraction as described in step S4 of claim 1; A reconstruction module is used to perform structural reconstruction of the extraction results as described in step S5 of claim 1; The processor is configured to perform the functions of the modeling module, the judgment module, the dynamic generation module, the route extraction module, and the reconstruction module. The memory stores instructions that can be executed by the processor, as well as a predefined template library and rule library.
10. The intelligent extraction and reconstruction system for nested fields based on a large model according to claim 9, characterized in that, The template library includes a schema template library and a prompt word template library; The schema template library includes binary existence judgment instruction templates and content extraction instruction templates; The prompt word template library includes binary prompt word templates and content extraction prompt word templates, and the binary existence judgment instruction template and content extraction instruction template correspond to the binary prompt word template and content extraction prompt word template, respectively. The rule base mentioned above includes a policy rule base; The policy rule base stores extraction policy rules corresponding to different field types. The routing extraction module extracts the field types in the schema based on the content, queries the policy rule base to determine and execute the corresponding extraction policy rules.
Citation Information
Patent Citations
Small sample nesting relation extraction method based on dynamic prompt learning
CN115409011A
Government affair intelligent interaction and information extraction method and device, equipment and medium
CN120996013A
Structured information extraction method and system based on large language model
CN121388154A
Data auditing method and device based on artificial intelligence, electronic equipment and storage medium
CN121882052A