Big model-based document content customized extraction method and system
By employing a document content customization extraction method based on a large model and utilizing structured prompts and interactive output results for iterative optimization, this approach addresses the issues of insufficient versatility and high customization threshold in existing technologies. It achieves efficient, accurate, and customized parsing of multimodal documents and provides an intelligent tool for extracting key document information.
Patent Information
- Application Number
- CN202511293012.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-10-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies suffer from insufficient versatility, high customization barriers, and low processing efficiency when processing multimodal and unstructured documents, making it difficult to achieve intelligent, efficient, and flexible extraction of key document information across different scenarios.
By employing a large-model-based method for customized document content extraction, and utilizing structured prompts and interactive output results for iterative optimization, the method calls upon the large model to extract document content, including multimodal content parsing of text and images. Customized extraction is achieved through structured prompts, thereby improving output accuracy.
It enables efficient, accurate, and customized parsing of multimodal content such as text and images in documents, providing users with an intelligent, efficient, and flexible tool for extracting key information from documents, saving time and costs, and adapting to the needs of complex document processing and data mining.
Smart Images

Figure CN120821835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and document processing technology, and in particular to a method and system for customized extraction of document content based on a large model. Background Art
[0002] With the deepening of digitalization, document data has become more diverse, dynamic, and massive. This applies to a wide range of fields, including financial analysis, legal agreements, scientific research documents, and technical manuals. Users' demand for accurate and efficient access to core information has expanded from single scenarios to complex, cross-industry, and multimodal scenarios. Traditional document information extraction technologies primarily rely on rule engines, regular expressions, or template-based matching methods. While these technologies can play a fundamental role in processing highly structured or simple semi-structured data, their core limitations lie in their lack of generalization and adaptability. Especially when dealing with unstructured documents, mixed heterogeneous formats, or long texts with high semantic coupling, the problems faced by existing technical systems include: First, rule-based methods require pre-defined parsing logic for different document types, and the development cycle and maintenance costs increase nonlinearly with the complexity of the format. They lack generalization and are difficult to adapt to dynamically evolving document forms; second, traditional natural language processing models are limited by domain-specific training data, and are prone to semantic generalization deviations when migrating across scenarios, and lack deep interactive capabilities for user intent; finally, existing solutions often find it difficult to balance extraction accuracy and processing efficiency. Complex document parsing is often accompanied by high computing power consumption and response delays, which restricts large-scale applications.
[0003] In current technology, engines based on regular expressions or template matching can handle shallow parsing of fixed-format documents. However, when dealing with multi-level nested structures, heterogeneous data mixtures, or non-standardized expressions, a large number of complex rules need to be manually designed, and the cost of resolving conflicts between rules and version iterations increases sharply. Although some methods that introduce machine learning have improved the ability to generalize patterns, they still rely on labeled data for model fine-tuning, making it difficult to achieve rapid adaptation under zero-sample conditions. In recent years, general large models have provided a new paradigm for document parsing with their cross-domain semantic understanding and contextual reasoning capabilities. However, directly applying large models for content extraction has significant shortcomings: general generative outputs often lack the ability to organize structured information, resulting in a mixture of key information and redundant content. At the same time, users' personalized needs for extraction dimensions (such as multi-field combinations, cross-paragraph associations, or dynamic filtering conditions) are difficult to achieve through simple instructions. They usually rely on complex parameter adjustments or customized model training, and the technical threshold and application costs remain high.
[0004] While existing technologies attempt to integrate large models to optimize information extraction processes, most solutions are limited to specific tasks, such as structuring medical reports or entity extraction, and lack a universal architecture design across scenarios. Regarding dynamic adaptation, traditional systems lack a lightweight mapping mechanism between user needs and model capabilities. This results in customized services being highly dependent on the intervention of professional engineers, making it difficult for users to independently configure their services. Summary of the Invention
[0005] The task of the present invention is to provide a customized document content extraction method and system based on a large model. Through the method and / or system, the problems of insufficient versatility, high customization threshold and low processing efficiency in the existing technology are solved, and users are provided with an intelligent, efficient and flexible document key information extraction tool.
[0006] In a first aspect of the present invention, the aforementioned task is solved by a method for customized document content extraction based on a large model, the method comprising the following steps: Input documents and classify them into text documents or image documents; Develop structured prompts based on documents and user needs; Calling the large model to process the document, extracting content based on the structured prompt words, and generating preliminary extraction results; Comparing the preliminary extraction results with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction results meet the accuracy threshold; and Confirm that the extraction result that meets the accuracy threshold meets the extraction target and is stored as a final extraction result, and save the final extraction result in an output format.
[0007] Furthermore, the document includes text or table or image or curve; and / or Convert tables to text when classifying documents; and / or When classifying documents, convert curves into images.
[0008] Furthermore, the structured prompt word includes a role positioning module, a target extraction module, a document content module and an output constraint module; The role positioning module is configured to define the professional domain attributes of the large model; The extraction target module is configured to declare the fields to be extracted and the processing rules; The document content module is configured to specify document content; and The output constraint module is configured to specify a structured output format.
[0009] Furthermore, the large model includes one or more of a web page version, a client, an application software, and a locally deployed large model; and / or The large model includes Deepseek or Kimi or Tongyi Qianwen or Doubao or ChatGPT; and / or When calling a locally deployed large model, batch document processing is achieved by combining the large model with Python.
[0010] Furthermore, comparing the preliminary extraction results with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction results meet the accuracy threshold include: Compare the field missing rate of the extraction results with that of the extraction target and the accuracy of the extracted information; The missing rate is the ratio of the fields that failed to be extracted in the extraction results to the total fields in the extraction target. When the missing rate is greater than 5%, the field description is supplemented or the processing rules are added to the structured prompt words to strengthen the extraction of the missing parts, and the large model is re-used to reduce the missing rate to ≤ 2%. The accuracy rate is the degree of consistency between the extracted information and the actual information. When the accuracy rate is <95%, supplement the field description or process the rules to the structured prompt words to improve the extraction accuracy of the large model, and re-call the large model to an accuracy rate of ≥99%.
[0011] Furthermore, the extraction result is constrained to a structured format according to the structured prompt words, and the structured format includes JSON or Markdown.
[0012] Furthermore, the large model-based customized document content extraction method also includes: preprocessing image documents and adjusting brightness, contrast or saturation parameters to reduce optical recognition noise.
[0013] In a second aspect of the present invention, the aforementioned task is also solved by a system for implementing the aforementioned method for customized document content extraction based on a large model, the system comprising: A document classification module is configured to input a document and classify the document into a text document or an image document; A structured prompt word formulation module is configured to formulate structured prompt words according to documents and user requirements; A large model calling module is configured to call the large model to process the document, extract content based on the structured prompt words, and generate preliminary extraction results; an extraction result optimization module configured to compare the preliminary extraction result with the extraction target, update the structured prompt words for iterative optimization, and re-call the large model until the extraction result meets the accuracy threshold; The final extraction result saving module is configured to confirm that the extraction result that meets the accuracy threshold meets the extraction target and stores it as the final extraction result, and save the final extraction result in an output format.
[0014] In a third aspect of the present invention, an electronic device is further provided, comprising: a processor configured to execute machine-readable instructions; A graphics card with an artificial intelligence chip configured to train a large model-based customized document content extraction method; and The memory is configured to store machine-readable instructions, which, when executed by the processor and / or the graphics card, perform the steps of the large model-based customized document content extraction method.
[0015] In a fourth aspect of the present invention, a computer-readable storage medium is provided on which machine-readable instructions are stored. When the machine-readable instructions are executed by a processor, the steps of the customized document content extraction method based on a large model are performed.
[0016] The technical solution provided by the present invention has the following advantages: 1. The large-model-based customized document content extraction method proposed in this invention achieves efficient, accurate, and customized analysis of multimodal content such as text and images in documents by calling the large model, structured prompt words, and interactively outputting results, providing users with an intelligent, efficient, and flexible document key information extraction tool.
[0017] 2. The customized document content extraction method based on a large model proposed in the present invention realizes efficient extraction of multimodal document content information through large model calls, realizes customized extraction through structured prompt words, and improves output accuracy through an interactive process, saving users a lot of time costs and bringing significant results and benefits.
[0018] 3. As the number of documents continues to increase and the complexity of carriers continues to increase in the future, the customized document content extraction method based on large models proposed in this invention is expected to expand its scope of application and provide users with greater convenience in document processing, data mining, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To further illustrate the above and other advantages and features of various embodiments of the present invention, a more detailed description of various embodiments of the present invention will be presented with reference to the accompanying drawings. It will be understood that these drawings depict only typical embodiments of the present invention and are not to be considered as limiting the scope thereof. In the drawings, for clarity, identical or corresponding components will be represented by the same or similar reference numerals.
[0020] Figure 1A schematic diagram showing a process flow of a customized document content extraction method based on a large model according to an embodiment of the present invention; Figure 2 A schematic diagram of a large model-based customized document content extraction system according to an embodiment of the present invention is shown; and Figure 3 A schematic diagram of a large model-based customized document content extraction system according to another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0021] In the following description, the present invention is described with reference to various embodiments. However, those skilled in the art will recognize that the embodiments may be implemented without one or more of the specific details or with other alternative and / or additional methods or components. In other cases, well-known structures or operations are not shown or described in detail to avoid obscuring the inventive aspects of the present invention. Similarly, specific numbers and configurations are set forth for illustrative purposes in order to provide a comprehensive understanding of the embodiments of the present invention. However, the present invention is not limited to these specific details.
[0022] In this specification, reference to "one embodiment" or "the embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. The appearances of the phrase "in one embodiment" in various places in this specification are not necessarily all referring to the same embodiment.
[0023] It should be noted that the embodiments of the present invention describe the method steps in a specific order, but this is only for the purpose of illustrating the specific embodiment and does not limit the order of the steps. On the contrary, in different embodiments of the present invention, the order of the steps can be adjusted according to actual needs.
[0024] In the present invention, each module of the system according to the present invention can be implemented using software, hardware, firmware, or a combination thereof. When a module is implemented using software, the module's functions can be implemented through a computer program flow. For example, the module can be implemented using a code segment (e.g., a code segment written in a language such as C or C++) stored in a storage device (e.g., a hard disk, memory, etc.), wherein the corresponding module functions can be implemented when the code segment is executed by a processor. When a module is implemented using hardware, the module's functions can be implemented by setting up a corresponding hardware structure. For example, the module's functions can be implemented by hardware programming a programmable device such as a field programmable gate array (FPGA), or by designing an application-specific integrated circuit (ASIC) including electronic components such as multiple transistors, resistors, and capacitors. When a module is implemented using firmware, the module's functions can be written into a read-only memory (ROM) or EEPROM of the device in the form of program code, and the corresponding module functions can be implemented when the program code is executed by the processor. In addition, certain functions of the module may need to be implemented by separate hardware or through collaboration with the hardware, for example, the detection function is implemented by corresponding sensors (such as proximity sensors, accelerometers, gyroscopes, etc.), the signal transmission function is implemented by corresponding communication devices (such as Bluetooth devices, infrared communication devices, baseband communication devices, Wi-Fi communication devices, etc.), the output function is implemented by corresponding output devices (such as displays, speakers, etc.), and so on.
[0025] In response to the core problems of the inability to accurately and customise the extraction of multimodal data from various existing technologies or record documents, as well as the lack of versatility, high customization threshold and low processing efficiency in existing technologies, the present invention provides a customized document content extraction method based on a large model. By applying a general model architecture and using prompt words to dynamically define extraction rules and targets, it achieves intelligent parsing of documents in different formats and fields. It has the characteristics of being able to process various types of documents such as common scientific and technological literature, test reports and protocol records, and to extract and summarize the key content of articles in a customised and accurate manner, thereby providing users with an intelligent, efficient and flexible document key information extraction tool.
[0026] Figure 1 The following is a flow chart showing a customized document content extraction method based on a large model according to an embodiment of the present invention. Figure 1 , the document content customized extraction method based on the large model proposed by the present invention is described. In one embodiment of the present invention, the document content customized extraction method based on the large model can be executed by a computer. Figure 1 As shown, the customized document content extraction method based on the large model includes the following steps: Step 101: Input a document and classify it into a text document or an image document. In one embodiment of the present invention, the document can be subdivided into text, tables, images, curves, etc.; and / or when classifying the document, the table can be converted into text; and / or when classifying the document, the curve can be converted into an image.
[0027] In one embodiment of the present invention, image documents are converted into text via optical character recognition (OCR) and input into the large model; and / or text documents are directly input into the large model.
[0028] In one embodiment of the present invention, before this step, the following step may be included: pre-processing the image document, wherein the pre-processing includes adjusting brightness, contrast or saturation parameters, etc., to reduce OCR noise and improve extraction accuracy.
[0029] Step 102, formulate structured prompt words according to the document and user needs. Modify the prompt word content in a targeted manner for different modal contents, highlight the characteristics of text, tables, images, etc., and improve the extraction accuracy. In one embodiment of the present invention, the structured prompt words include a role positioning module, an extraction target module, a document content module, and an output constraint module, etc.; wherein the role positioning module is configured to define the professional field attributes of the large model; the extraction target module is configured to declare the fields to be extracted and the processing rules; the document content module is configured to specify the document content; and the output constraint module is configured to specify the structured output format. In one embodiment of the present invention, a templated structured prompt word is provided: for example, including modules such as {identity}; {task file type}; {task file field}; {extraction requirement description}.
[0030] Step 103: Call the large model to process the document, extract content based on the structured prompt words, and generate preliminary extraction results.
[0031] In one embodiment of the present invention, a large model is selected for document content recognition processing, and the large model includes one or more of a web version, a client, an application software, and a locally deployed large model; and / or the large model includes Deepseek or Kimi or Tongyi Qianwen or Doubao or ChatGPT or other applicable large models.
[0032] In one embodiment of the present invention, the large model can be called in one or more of the following ways: calling through a webpage interactive interface, batch processing through an API interface, and calling through a locally deployed large model. When calling a locally deployed large model, batch document processing can be achieved by using the large model in conjunction with Python. It is worth noting that calling through a webpage interactive interface is generally a free service, and the parameters of the large model are large enough for normal use; however, manual copying and pasting are required to generate content, and the task is relatively open to the Internet, resulting in low data security. In addition, the webpage version sometimes freezes, making it impossible to call it in large quantities. It is worth noting that for batch processing through an API interface, large model service providers will provide related services. The advantage is that the data stream can be machine-readable and will not freeze, making it suitable for batch operations, but a fee is required. It is worth noting that calling through a locally deployed large model requires the construction of a server, and data security and other aspects are guaranteed. However, the parameter volume that can be run on a general device is relatively small, and running a fully configured large model requires equipment investment.
[0033] Large models primarily recognize text input. Ensuring text recognition requires preprocessing, which can be categorized into various scenarios. For direct calls to the web version, the web backend can directly preprocess the file by inputting the file. In this case, modules like OCR are not required. However, for local models or API calls, file preprocessing is necessary, requiring the participation of modules like OCR to ensure that the multimodal input content is converted into text. Of course, large models also support direct reading of images, which also involves a certain amount of preprocessing.
[0034] When processing unstructured content (such as images of handwritten notes), optical recognition tools such as OCR can be used to extract the input image content. While a simple OCR module may not be able to distinguish between printed and handwritten text, the large-scale model's image understanding capabilities allow it to distinguish handwritten text and extract relevant content. This capability can be achieved by ensuring that structured prompts are covered within the structured prompts, guided by specific modules, ensuring the large-scale model understands the target task. The structured prompt template, such as the one in the example above, can be further elaborated in the {Extraction Requirements} module to enhance the large-scale model's accuracy in completing the task.
[0035] Step 104 : compare the preliminary extraction result with the extraction target, update the structured prompt words for iterative optimization, and re-call the large model until the extraction result meets the accuracy threshold.
[0036] In one embodiment of the present invention, the structured prompt words can be manually updated as needed, or the prompt word parts that need to be adjusted can be further solidified. It should be noted that the compilation of structured prompt words may require a certain degree of flexibility.
[0037] In one embodiment of the present invention, the extraction results can be constrained into a structured format according to user needs through prompt words to facilitate storage and further analysis and processing; the structured format can include JSON or Markdown.
[0038] In one embodiment of the present invention, comparing the preliminary extraction result with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction result meets the accuracy threshold includes: Compare the field missing rate of the extraction results with that of the extraction target and the accuracy of the extracted information; The missing rate is the ratio of the fields that failed to be extracted in the extraction results to the total fields in the extraction target. When the missing rate is greater than 5%, the field description is supplemented or the processing rules are added to the structured prompt words to strengthen the extraction of the missing parts, and the large model is re-used to reduce the missing rate to ≤ 2%. Accuracy is the degree of consistency between the extracted information and the actual information. When the accuracy is <95%, field descriptions or processing rules are added to the structured prompt words to improve the large model's extraction accuracy, and the large model is re-activated to an accuracy of ≥99%. It is worth noting that conventional large model applications are essentially zero-template extraction, with users randomly inputting to complete the large model call. However, this can lead to insufficient extraction accuracy and unclear directionality, causing the large model to perform haphazardly. In this case, the content extracted by the large model faces several uncertainties: uncertainty in the extraction structure, which can be chaotic and difficult to further process; uncertainty in the extraction target, which can lead to biases in multiple tasks, with some preferring to read tables or text, and even in relatively specialized scenarios, focusing on one area or another; and uncertainty in the extracted content, which, without constraints, can sometimes lead to divergence in the large model and even introduce other free-form content, adding unnecessary complexity to data post-processing. The present invention ensures the accuracy of the extracted content and improves efficiency through structured prompt words and the associated call process. Furthermore, the necessary iteration process is required to prevent fluctuations in the large model's performance across multiple tasks and to impose constraints on human intervention.
[0039] It's worth noting that the large model can be simply described in the structured prompts and appropriately constrained. The structured prompts can also be updated manually or packaged into specific modules. The number of iterative optimizations depends on the task requirements; two or three iterations are generally appropriate. Multiple iterations can introduce additional artifacts into the large model.
[0040] Step 105: confirm that the extraction result that meets the accuracy threshold meets the extraction target and is stored as the final extraction result, and save the final extraction result in an output format. In one embodiment of the present invention, the output format includes Excel format, Word format, TXT format, etc.
[0041] The present invention completes structured or semi-structured data through prompt words, which can provide preprocessing for subsequent further storage, processing, mining, etc., thereby improving the application value of data.
[0042] The customized document content extraction method based on a large model proposed in the present invention realizes efficient, accurate and customized analysis of multimodal content such as text and images in documents by calling a large model, structured prompt words and interactive output result iteration, providing users with an intelligent, efficient and flexible document key information extraction tool; efficient extraction of multimodal document content information is achieved through large model calling, customized extraction is achieved through structured prompt words, and output accuracy is improved through an interactive process, which saves users a lot of time and cost and brings significant results and benefits; as the number of documents will continue to increase in the future and the complexity of carriers will continue to increase, the customized document content extraction method based on a large model proposed in the present invention is expected to expand the scope of application and provide users with greater convenience in document processing, data mining and other aspects.
[0043] The following examples illustrate the effect of the large model-based customized document content extraction method proposed in the present invention.
[0044] In a first embodiment, a method for extracting tables from image-type PDF documents is provided, the method comprising the following steps: performing document processing, backing up the document and deleting non-table pages therefrom; formulating structured prompt words, an example of which is provided in this embodiment as follows: "Role positioning: You are a professional document analysis assistant, strictly following the requirements to extract document content; Extraction target: Extract all table contents in the input document; Document content: Preprocess image-type PDF attachments; Output requirements: Output all table contents in the original format in Markdown format"; calling a large model, in this embodiment, selecting a webpage version of the general model, inputting the preprocessed document and structured prompt words, and completing large-model assisted text extraction; comparing the model output results with the document table content, confirming the extraction accuracy of complex content such as merged tables and paginated tables, and optimizing the prompt words in combination with the extraction target, such as supplementing the processing of merged tables in the extraction target and optimizing the prompt words as follows: "Extraction target: Extract all table contents in the input document; for merged cells, automatically fill the split table with the content of the merged cells"; after confirming that the extracted content is correct, saving it to an Excel document or a TXT document and storing it to the target location.
[0045] This example implements efficient extraction of multimodal document content information through large model calls and customized extraction through structured prompt words, reflecting the efficiency and customization of this method.
[0046] In a second embodiment, a method for extracting key content from a text-type PDF document is provided, comprising the following steps: performing document processing, confirming the text type, and deleting non-essential content such as references if necessary; formulating structured prompt words, and this embodiment provides an example of a structured prompt word as follows: "Role positioning: You are a professional radiation effect analysis assistant, strictly following the requirements to extract document content; extraction target: extracting device radiation effect information from the input document, specifically including device information involved in the document, device model, manufacturer, manufacturing process, radiation test site, test parameters, radiation effect type, radiation effect and other information; document content: pre-processing text-type PDF attachment; output requirements: output the summary of the extracted content, strictly in the following JSON format"; calling a large model, this embodiment selects an API interface, inputs a pre-processed text-type PDF document and structured prompt words, and completes large-model assisted text extraction; comparing the output result with the document content, and preparing the output result after confirmation; the result can be selectively saved to an Excel document or a TXT document to facilitate subsequent in-depth data analysis.
[0047] The code of the structured prompt word can be, for example: {{ "components":[ {{ "component_name": "Device name", "model_number": "Device model", “manufacturer”: “manufacturer”, “manufacturing_process”: “manufacturing process”, "test_site": "test site", "test_conditions":{{ "bias_voltage": "bias voltage", “temperature”: “temperature conditions” }}, "radiation_effect":{{ "effect_type": "Total dose / single event effect", "latchup": "latch situation", “burnout”: “burned” “details”: “Effect details” }}, "page_number": page number }} ] }} An exemplary output result of the second embodiment is as follows: { "components":[ { "component_name":"QorIQ P2020", "model_number":"P2020", “manufacturer”: “NXP”, "manufacturing_process": "Not mentioned", "test_site":"UCL Louvain (62MeV proton source)", "test_conditions":{ "bias_voltage": "Not mentioned", “temperature”: “Not mentioned” }, "radiation_effect":{ "effect_type": "Single Event Effect (SEFI)", "latchup": "none", "burnout": "none", “details”:[ "L1 / L2 cache parity or ECC error", "Program Exception (SEFI-3)", "System timeout (SEFI-4)", "Output error (SEFI-6)", "Performance score error (SEFI-7)" ] }, "page_number":[2,4] }, { "component_name": "microcontroller", "model_number": "Hercules series", "manufacturer":"Texas Instruments", "manufacturing_process": "Not mentioned", "test_site":"UCL Louvain (62MeV proton source)", "test_conditions":{ "bias_voltage": "Not mentioned", “temperature”: “Not mentioned” }, "radiation_effect":{ "effect_type": "Single Event Effect (SEFI)", "latchup": "none", "burnout": "none", “details”:[ "ECC error (SEFI-1)", "Auto-reset event (SEFI-9)", "No output errors observed" ] }, "page_number":[2,4] } ] } This embodiment realizes customized extraction of text content by writing prompt words in a targeted manner, which fully reflects the characteristics of this method such as high versatility and low customization threshold.
[0048] In the third embodiment, a method for extracting key content from image documents is provided, which includes the following steps: pre-processing to confirm that the image content contains target information, adjusting image brightness, contrast, saturation and other parameters to reduce the probability of noise caused by image quality; formulating structured prompt words, and this embodiment provides an example of prompt words as follows: "Role positioning: You are a professional image analysis assistant, strictly following the requirements to extract image content; Extraction target: Extract all content in the input image; Document content: Pre-process image attachments; Output requirements: Output all image content in the original format"; Call the large model, this embodiment selects the locally deployed model, inputs the pre-processed image and structured prompt words, and completes the large model-assisted content extraction. The output result is as follows" start Document confirmation and document classification Text / image / table modality classification Prompt Word Project Content extraction based on large models Structural prompt word optimization Is the content necessary? To optimize Confirm the output content and select the storage location Finish ” In a third embodiment, after the above steps, the method for extracting key content from image documents further includes the following steps: comparing the output result with the image content, and strictly implementing the requirement of outputting the image content in its original format. However, the text in the same module is split and the logical structure is broken up. To further improve the accuracy of the extracted content, a new requirement is added: "Output requirement: output the image content in its original format, and save the content in a JSON structure according to the logical order for storage." After updating the prompt word, call the local model to assist in content extraction again, and the output result is as follows: { "process_flow":[ { "node_name": "start", "node_type":"start", “next_node”: “Document confirmation, document classification” }, { “node_name”: “Document confirmation, document classification”, "node_type":"operation", "next_node": "text / image / table modality classification" }, { "node_name": "Text / Image / Table Modality Classification", "node_type":"operation", “next_node”: “Prompt Word Project” }, { "node_name": "Prompt Word Project", "node_type":"operation", “next_node”: “Content extraction based on large models” }, { "node_name": "Content extraction based on large models", "node_type":"operation", “next_node”: “Does the content need to be optimized?” }, { "node_name": "Does the content need to be optimized?" "node_type":"decision", "next_nodes":{ “yes”: “Structured prompt word optimization”, “no”: “Confirm the output content and select the storage location” } }, { "node_name": "Structured prompt word optimization", "node_type":"operation", “next_node”: “Prompt Word Project” }, { “node_name”: “Confirm the output content and select the storage location”, "node_type":"operation", "next_node": "end" }, { "node_name": "end", "node_type":"end" } ] } ” In a third embodiment, after the above steps, the method for extracting key content from picture documents further includes the following steps: the results can be selectively saved to a Word document or a txt document to facilitate subsequent data analysis.
[0049] This embodiment improves the accuracy of text content extraction through iterative optimization of prompt words, fully demonstrating the characteristics of this method such as strong adaptability and high flexibility.
[0050] Figure 2 FIG1 shows a schematic diagram of a customized document content extraction system based on a large model according to an embodiment of the present invention. Figure 2 As shown, the system includes: A document classification module is configured to input a document and classify the document into a text document or an image document; A structured prompt word formulation module is configured to formulate structured prompt words according to documents and user requirements; A large model calling module is configured to call the large model to process the document, extract content based on the structured prompt words, and generate preliminary extraction results; an extraction result optimization module configured to compare the preliminary extraction result with the extraction target, update the structured prompt words for iterative optimization, and re-call the large model until the extraction result meets the accuracy threshold; The final extraction result saving module is configured to confirm that the extraction result that meets the accuracy threshold meets the extraction target and stores it as the final extraction result, and save the final extraction result in an output format.
[0051] Figure 3 FIG1 shows a schematic diagram of a customized document content extraction system based on a large model according to another embodiment of the present invention. Figure 3 As shown, the system includes a document upload module, a large model selection and configuration module, a structured prompt word generation module, a content extraction and optimization module, and a result storage module. After the user uploads the file to be read, a structured prompt word template is generated by briefly describing the requirements. This template can be adaptively adjusted based on the needs. In the model configuration module, you can choose to call the API or the local model. After the structured prompt word extraction is completed, you can selectively iterate based on the output results. Finally, the results can be saved in different formats according to your needs.
[0052] In one embodiment of the present invention, the present invention further provides an electronic device comprising: a processor, a graphics card with an artificial intelligence chip, and a memory, wherein the memory is configured to store machine-readable instructions, the graphics card is configured to train the customized document content extraction method based on the large model, and the processor is configured to execute the machine-readable instructions. When the processor and / or the graphics card execute the machine-readable instructions, the following processing steps are implemented: inputting a document and classifying the document into a text document or an image document; formulating structured prompt words based on the document and user needs; calling the large model to process the document, extracting content based on the structured prompt words, and generating preliminary extraction results; comparing the preliminary extraction results with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction result meets the accuracy threshold; and confirming that the extraction result that meets the accuracy threshold meets the extraction target and is stored as the final extraction result, and saving the final extraction result in an output format.
[0053] The graphics card can preferably have a GPU computing power higher than 5.0. Since the amount of data required for training is large, providing a graphics card configuration can significantly improve the training speed.
[0054] The memory includes various media that can store machine-readable instructions, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0055] It can be understood that in addition to the memory and processor mentioned above, the above-mentioned computer system also includes other software and hardware components not listed in this specification. The specific components can be determined according to the model of the specific data processing equipment in different application scenarios. This specification will not list them one by one in detail.
[0056] In one embodiment of the present invention, the present invention also provides a computer-readable storage medium having machine-readable instructions stored thereon, which implement the following processing steps when executed by a processor: input a document and classify the document into a text document or an image document; formulate structured prompt words based on the document and user needs; call a large model to process the document, extract content based on the structured prompt words, and generate preliminary extraction results; compare the preliminary extraction results with the extraction target, update the structured prompt words for iterative optimization, and re-call the large model until the extraction result meets the accuracy threshold; and confirm that the extraction result that meets the accuracy threshold meets the extraction target and is stored as the final extraction result, and save the final extraction result in an output format.
[0057] Although various embodiments of the present invention have been described above, it should be understood that they are presented as examples only and not as limitations. It will be apparent to those skilled in the relevant art that various combinations, modifications, and variations may be made thereto without departing from the spirit and scope of the present invention. Therefore, the breadth and scope of the present invention disclosed herein should not be limited by the exemplary embodiments disclosed above, but should be defined based on the technical solutions of the present invention and their equivalents.
Claims
1. A customized document content extraction method based on a large model, characterized in that: The steps include: Input documents and classify them into text documents or image documents; Develop structured prompts based on documents and user needs; Calling the large model to process the document, extracting content based on the structured prompt words, and generating preliminary extraction results; Comparing the preliminary extraction results with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction results meet the accuracy threshold; as well as Confirm that the extraction result that meets the accuracy threshold meets the extraction target and is stored as a final extraction result, and save the final extraction result in an output format.
2. The method for customized document content extraction based on a large model according to claim 1, characterized in that: The document includes text or table or image or curve; and / or Convert tables to text when classifying documents; and / or When classifying documents, convert curves into images.
3. The method for customized document content extraction based on a large model according to claim 1, characterized in that: The structured prompt words include a role positioning module, a target extraction module, a document content module and an output constraint module; The role positioning module is configured to define the professional domain attributes of the large model; The extraction target module is configured to declare the fields to be extracted and the processing rules; The document content module is configured to specify document content; and The output constraint module is configured to specify a structured output format.
4. The method for customized document content extraction based on a large model according to claim 1, characterized in that: The large model includes one or more of a web page version, a client, an application software, and a locally deployed large model; and / or The large model includes Deepseek or Kimi or Tongyi Qianwen or Doubao or ChatGPT; and / or When calling a locally deployed large model, batch document processing is achieved by combining the large model with Python.
5. The method for customized document content extraction based on a large model according to claim 1, characterized in that: Comparing the preliminary extraction results with the extraction target, updating the structured prompt words for iterative optimization, and re-calling the large model until the extraction results meet the accuracy threshold includes: Compare the field missing rate of the extraction results with that of the extraction target and the accuracy of the extracted information; The missing rate is the ratio of the fields that failed to be extracted in the extraction results to the total fields in the extraction target. When the missing rate is >5%, the field description is supplemented or the processing rules are added to the structured prompt words to strengthen the extraction of the missing parts, and the large model is re-called to a missing rate of ≤2%; The accuracy rate is the degree of consistency between the extracted information and the actual information. When the accuracy rate is <95%, supplement the field description or process the rules to the structured prompt words to improve the extraction accuracy of the large model, and re-call the large model to an accuracy rate of ≥99%.
6. The method for customized document content extraction based on a large model according to claim 1, characterized in that: The extraction results are constrained to a structured format according to the structured prompt words, and the structured format includes JSON or Markdown.
7. The method for customized document content extraction based on a large model according to claim 1, characterized in that: Also includes: Preprocess image documents and adjust brightness, contrast, or saturation parameters to reduce optical recognition noise.
8. A system for implementing the large model-based customized document content extraction method according to any one of claims 1 to 7, characterized in that: include: A document classification module is configured to input a document and classify the document into a text document or an image document; A structured prompt word formulation module is configured to formulate structured prompt words according to documents and user requirements; A large model calling module is configured to call the large model to process the document, extract content based on the structured prompt words, and generate preliminary extraction results; an extraction result optimization module configured to compare the preliminary extraction result with the extraction target, update the structured prompt words for iterative optimization, and re-call the large model until the extraction result meets the accuracy threshold; The final extraction result saving module is configured to confirm that the extraction result that meets the accuracy threshold meets the extraction target and stores it as the final extraction result, and save the final extraction result in an output format.
9. An electronic device, characterized in that: include: a processor configured to execute machine-readable instructions; A graphics card with an artificial intelligence chip configured to train a customized document content extraction method based on a large model; as well as A memory configured to store machine-readable instructions, wherein the machine-readable instructions, when executed by a processor and / or a graphics card, perform the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Machine-readable instructions are stored thereon, which, when executed by a processor, perform the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Archive information extraction method and device, equipment, storage medium and program product
CN118626644A
BIM rule specification extraction method based on large model
CN119337992A
Enzyme activity parameter extraction method and system based on large language model
CN119443093A
Auditing method and system based on large language model
CN119577111A
Structured operation and maintenance document generation method and system and medium
CN120257961A
Cited By
Battery operation file generation method, device, equipment and program product
CN121562566A