Document information automatic input system and method based on large language model
The document information automatic entry system based on a large language model solves the problems of insufficient semantic understanding, weak multimodal processing, and lagging dynamic adaptation in existing technologies. It enables efficient, accurate, and dynamically adaptive information entry of multi-source policy documents, and improves the automated processing capability and information integrity of the entry system.
Patent Information
- Application Number
- CN202512053115.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies in document information entry systems suffer from insufficient semantic understanding capabilities, weak multimodal processing, lagging dynamic adaptation, and lack of correlation analysis, resulting in omissions of key information, low entry efficiency, high error rates, and an inability to meet real-time update requirements.
An automatic document information entry system based on a large language model is adopted, including an input module, a preprocessing module, a feature extraction module, a key information identification module, and an information verification module. The BERT-base model is used for format recognition and conversion, and the LoRA lightweight fine-tuning Qwen-72B model is used to extract semantic features. Combined with a hybrid retrieval engine and a multi-level verification mechanism, the system can achieve full-process automated processing of multi-source policy documents.
It has achieved fully automated processing of multi-source heterogeneous policy documents, improved the comprehensiveness and accuracy of key information extraction, has rapid adaptive capabilities, ensures the logical consistency and business compliance of entered information, and reduces the error rate.
Smart Images

Figure CN121935388A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph technology, specifically to a document information automatic entry system and method based on a large language model. Background Technology
[0002] Document information entry is a crucial technology for the operation of hydropower projects. Currently, some existing technologies offer automated document information entry systems based on intelligent processing. For example, Chinese patent "CN202110567890.3 Document Information Extraction System Based on Rule Engine" uses a predefined rule base to extract structured information, constructs a regular expression rule base, and designs matching rules for fixed formats. It extracts explicit structured fields such as titles, document numbers, and publication dates through character-level matching and integrates a basic format verification module to verify basic information such as date formats and numbering standardization. Another example is US patent "US20220124567A1 Policy Document Classification System Based on Traditional Machine Learning," which uses an SVM classifier to identify policy documents. The specific technical solution includes: manually labeling five categories to construct a training sample set; extracting keywords as feature vectors to train a classification model; setting a classification confidence threshold; and manually reviewing documents below the threshold. However, the aforementioned existing technologies have the following drawbacks: Lack of semantic understanding: It can only process explicit format information and has insufficient recognition rate of implicit semantics such as "This method shall come into effect from the date of promulgation", resulting in the omission of key information; Weak multimodal processing: The structured extraction of non-text elements such as tables and figures in scanned PDFs only achieves 65% completeness, requiring secondary manual processing; Dynamic adaptation lag: Rule base / model updates rely on manual intervention, and the response cycle to new policy statements in 2025 can be as long as 2-3 weeks, which cannot meet the needs of real-time updates; The verification mechanism is simplistic: it only verifies formats such as date formats and lacks the ability to verify the semantic logic of contradictory statements. Lack of correlation analysis: The system only processes single files and cannot identify complex relationships such as revisions and supplements between policies, resulting in fragmented compilation results. Therefore, it is necessary to design an automatic document information entry system and method based on a large language model to solve the above technical problems. Summary of the Invention
[0003] The purpose of this invention is to propose an automatic document information entry system and method based on a large language model. It aims to overcome the problems of low efficiency and high error rate of manual document entry in the prior art, as well as the high fine-tuning cost, poor knowledge timeliness, and imperfect verification mechanism of existing large model-assisted processing. It achieves high efficiency, accuracy, and dynamic adaptability of automatic document information entry, especially for national legal and policy documents, and can quickly and accurately complete information entry and intelligent compilation.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A document information automatic entry system based on a large language model, comprising: The input module is used to access multi-source policy data, including polling internal government system data through a RESTful API interface, scraping public network resources through the Scrapy framework combined with the Selenium tool, and extracting data in batches by directly connecting to historical databases through the JDBC protocol. The preprocessing module is used to perform format recognition and conversion, deduplication and noise filtering on policy data. This includes classifying text, image and mixed files based on the BERT-base model, using OCR to recognize and correct image files in combination with domain models, deduplicating using the SHA-256 hash algorithm, and filtering low-weight redundant content based on the TF-IDF algorithm. The feature extraction module is used to extract policy text features, including extracting semantic features using the Qwen-72B model with LoRA lightweight fine-tuning, constructing an inverted index through Jieba word segmentation, generating vectors based on Sentence-BERT and constructing a vector index through Faiss; The key information identification module is used to identify key policy information, including obtaining candidate knowledge using a hybrid retrieval engine (top 20 text matching of inverted index + top 20 semantically similar texts from Faiss vector search, merging and deduplicating to retain 30 entries), based on a dynamic weight formula. The system sorts and extracts 12 types of policy entity information using an entity recognition model in BIO annotation format. The information verification module is used to verify the extracted key information, including basic format verification based on schema, business rule verification based on Drools rule engine, and logical consistency verification based on Neo4j association graph; The information entry module is used to classify and store verified information into the database, record operation logs, dynamically adjust retrieval weights based on the EMA algorithm, and fine-tune the model every quarter by adding new data increments.
[0005] Preferably, the input module is configured with an interface retry mechanism (3 automatic retries + email alerts), network crawling proxy IP polling (10 proxies) and request interval control (5 seconds / time). Historical data is extracted using a "release year + domain" table partitioning strategy, with 1000 records extracted in batches each time.
[0006] Preferably, the format conversion in the preprocessing module includes: identifying image files using TesseractOCR and correcting errors using a domain text correction model; extracting text from mixed files using PyPDF2, parsing tables using Camelot, and converting them to CSV format.
[0007] Preferably, the LoRA fine-tuning strategy in the feature extraction module is as follows: Freeze 90% of the Transformer parameters at the bottom layer of Qwen-72B, and add low-rank adapter matrices to the top classifier and the middle four layers. (Rank r=16, hidden layer dimension d=4096), the parameter update formula is: ; in, It is the adapter matrix after freezing the underlying Transformer parameters.
[0008] Preferably, in the key information identification module, the IntentScore of the dynamic weight formula determines the query type by fine-tuning the BERT-Mini model, with factual type = 1 and open type = 0; Confidence is the model's confidence in the query classification, with a value range of 0-1.
[0009] Preferably, the automatic document information entry method based on a large language model includes the following steps: Access policy data from multiple sources, obtain data through API interfaces, web scraping and direct database connections, and configure retry and proxy mechanisms to ensure stability; Preprocess the data by identifying and converting file formats based on the BERT-base model (OCR correction of image files, extraction of text and tables from mixed files), and filtering noise using SHA-256 hash deduplication and TF-IDF algorithm. Text features are extracted, and a feature system is constructed using the LoRA-tuned Qwen-72B model, inverted index, and vector index. Key information is identified, candidate knowledge is obtained through hybrid retrieval and sorted based on dynamic weights, and more than 12 types of entity information are extracted using the BIO annotation format; Multi-level verification information performs basic format verification, business rule verification, and related logic verification, triggering manual correction prompts. Enter and optimize information, categorize and store information in the database, record logs, adjust retrieval weights based on the EMA algorithm, and fine-tune the model incrementally every quarter.
[0010] Preferably, the TF-IDF calculation formula in the preprocessing is: ,in Let t be the frequency of word t in document d. .
[0011] Preferably, the basic verification in the multi-level verification is performed using regular expressions. Verify the effective date format; automatically complete missing information when loading 200+ policy rules for business rule validation; and detect policy clause conflicts through the Neo4j graph database for correlation validation.
[0012] Preferably, a computer device includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the document information automatic input method based on a large language model.
[0013] Preferably, a computer-readable storage medium is provided, on which computer instructions are stored, which are used to cause the computer to execute the document information automatic entry method based on a large language model.
[0014] Compared with the prior art, the present invention has the following technical effects: 1. This invention achieves fully automated processing of multi-source heterogeneous policy documents by constructing a complete system architecture comprising an input module, a preprocessing module, a feature extraction module, a key information identification module, an information verification module, and an information entry module. Specifically, the system employs a semantic feature extraction and hybrid retrieval engine based on a large language model, enabling it to deeply understand the implicit semantics in policy texts, such as expressions like "This regulation shall come into effect from the date of its promulgation." Combined with a multimodal processing mechanism, it effectively parses the tables and images in scanned PDFs, thereby solving the problems of insufficient semantic understanding and incomplete multimodal information extraction in existing technologies, significantly improving the comprehensiveness and accuracy of key information extraction.
[0015] 2. This invention achieves rapid adaptive capability to policy changes by introducing a LoRA lightweight fine-tuning strategy and a dynamic weight adjustment mechanism. Specifically, when fine-tuning the large model, the system freezes most parameters and performs lightweight updates only through a low-rank adapter. Combined with quarterly incremental fine-tuning and dynamic EMA weight adjustment strategies, the system can respond promptly to new policy statements and domain changes. This overcomes the shortcomings of traditional methods, such as reliance on manual rule base and model updates and long response cycles, effectively ensuring the system's timeliness and adaptability in long-term use.
[0016] 3. This invention achieves comprehensive verification and error correction of extracted information by designing a multi-level verification system that includes basic format verification, business rule verification, and correlation logic verification. The system not only verifies basic formats such as dates and document numbers, but also automatically completes missing information through a rule engine and detects logical conflicts and relationships between policy clauses based on the Neo4j knowledge graph. This solves the problems of existing technologies having a single verification mechanism and lacking semantic logic and correlation analysis capabilities, ensuring the logical consistency of the entered information, business compliance, and the integrity of the overall knowledge structure. Attached Figure Description
[0017] Figure 1 This is a system structure diagram of the present invention. Detailed Implementation
[0018] Example 1: like Figure 1 As shown, the document information automatic entry system based on a large language model includes: The input module is used to access multi-source policy data, including polling internal government system data through a RESTful API interface, scraping public network resources through the Scrapy framework combined with the Selenium tool, and extracting data in batches by directly connecting to historical databases through the JDBC protocol. The preprocessing module is used to perform format recognition and conversion, deduplication and noise filtering on policy data. This includes classifying text, image and mixed files based on the BERT-base model, using OCR to recognize and correct image files in combination with domain models, deduplicating using the SHA-256 hash algorithm, and filtering low-weight redundant content based on the TF-IDF algorithm. The feature extraction module is used to extract policy text features, including extracting semantic features using the Qwen-72B model with LoRA lightweight fine-tuning, constructing an inverted index through Jieba word segmentation, generating vectors based on Sentence-BERT and constructing a vector index through Faiss; The key information identification module is used to identify key policy information, including obtaining candidate knowledge using a hybrid retrieval engine (top 20 text matching of inverted index + top 20 semantically similar texts from Faiss vector search, merging and deduplicating to retain 30 entries), based on a dynamic weight formula. The system sorts and extracts 12 types of policy entity information using an entity recognition model in BIO annotation format. The information verification module is used to verify the extracted key information, including basic format verification based on schema, business rule verification based on Drools rule engine, and logical consistency verification based on Neo4j association graph; The information entry module is used to classify and store verified information into the database, record operation logs, dynamically adjust retrieval weights based on the EMA algorithm, and fine-tune the model every quarter by adding new data increments.
[0019] Preferably, the input module is configured with an interface retry mechanism (3 automatic retries + email alerts), network crawling proxy IP polling (10 proxies) and request interval control (5 seconds / time). Historical data is extracted using a "release year + domain" table partitioning strategy, with 1000 records extracted in batches each time.
[0020] Preferably, the format conversion in the preprocessing module includes: identifying image files using TesseractOCR and correcting errors using a domain text correction model; extracting text from mixed files using PyPDF2, parsing tables using Camelot, and converting them to CSV format.
[0021] Preferably, the LoRA fine-tuning strategy in the feature extraction module is as follows: Freeze 90% of the Transformer parameters at the bottom layer of Qwen-72B, and add low-rank adapter matrices to the top classifier and the middle four layers. (Rank r=16, hidden layer dimension d=4096), the parameter update formula is: ; in, It is the adapter matrix after freezing the underlying Transformer parameters.
[0022] Preferably, in the key information identification module, the IntentScore of the dynamic weight formula determines the query type by fine-tuning the BERT-Mini model, with factual type = 1 and open type = 0; Confidence is the model's confidence in the query classification, with a value range of 0-1.
[0023] The method for automatic document information entry based on a large language model includes the following steps: Access policy data from multiple sources, obtain data through API interfaces, web scraping and direct database connections, and configure retry and proxy mechanisms to ensure stability; Preprocess the data by identifying and converting file formats based on the BERT-base model (OCR correction of image files, extraction of text and tables from mixed files), and filtering noise using SHA-256 hash deduplication and TF-IDF algorithm. Text features are extracted, and a feature system is constructed using the LoRA-tuned Qwen-72B model, inverted index, and vector index. Key information is identified, candidate knowledge is obtained through hybrid retrieval and sorted based on dynamic weights, and more than 12 types of entity information are extracted using the BIO annotation format; Multi-level verification information performs basic format verification, business rule verification, and related logic verification, triggering manual correction prompts. Enter and optimize information, categorize and store information in the database, record logs, adjust retrieval weights based on the EMA algorithm, and fine-tune the model incrementally every quarter.
[0024] Preferably, the TF-IDF calculation formula in the preprocessing is: ,in Let t be the frequency of word t in document d. .
[0025] Preferably, the basic verification in the multi-level verification is performed using regular expressions. Verify the effective date format; automatically complete missing information when loading 200+ policy rules for business rule validation; and detect policy clause conflicts through the Neo4j graph database for correlation validation.
[0026] Preferably, a computer device includes a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the document information automatic input method based on a large language model.
[0027] Preferably, a computer-readable storage medium is provided, on which computer instructions are stored, which are used to cause the computer to execute the document information automatic entry method based on a large language model.
[0028] Example 2: This embodiment proposes an automatic document information entry system based on a large language model, which includes the following modules: 1. Input module: The intelligent multi-source data acquisition framework module constructs a multi-source heterogeneous data access system to achieve accurate and stable acquisition of all-channel policy data such as government internal systems, public network resources, and historical record libraries, providing comprehensive data support for subsequent processing. The technology realizes the classified access of multi-source data: Government internal system data: Connect to internal platforms such as government affairs OA and policy management systems through RESTful API interfaces, configure a 30-minute timed polling mechanism to obtain newly released documents in real time; set up a 3-time automatic retry mechanism to handle interface fluctuations, and trigger an email alarm after failure to ensure the continuity of data acquisition. Public network resources: Use the Scrapy framework combined with the Selenium dynamic parsing tool to crawl policy documents on the official websites of the State Council and various ministries and commissions, extract metadata such as titles and download links through XPath positioning of the "policy documents" column; configure 10 proxy IPs for polling and a 5-second request interval to avoid website access restrictions and support the simulated scrolling loading of dynamic pagination content. Historical record library data: Directly connect to the enterprise policy archive MySQL database through the JDBC protocol, adopt a sub-table storage strategy by "release year + field" (such as "2023_fiscal policy", "2022_tax policy"), and extract 1000 historical policy records in batches each time to improve data reading efficiency.
[0029] 2. Preprocessing module: Identify, convert, deduplicate, and filter noise from the collected data, convert heterogeneous data into a standardized format, and lay a foundation for feature extraction and key information identification. The technology realizes adaptive format identification: Classify the file content based on the BERT-base model, identify three types of formats: text type (TXT / Word), image type (scanned PDF), and mixed type (PDF containing tables). When the format identification probability P(F)≥0.9, determine the type to ensure classification accuracy. Format conversion: For image-type files: Use the Tesseract OCR tool to identify text, and combine the text correction model in the power field to repair recognition errors (such as correcting "2024 noon" to "2024 year"); for mixed-type files: Extract text content through PyPDF2, use the Camelot tool to parse table data and convert it into CSV format to achieve structured extraction of text and tables. Data cleaning: Deduplication processing: Generate a unique identifier through the SHA-256 hash algorithm (Hash = SHA256(full text content + title + release date)), compare the hash values to delete duplicate files; noise filtering: Filter redundant content based on the TF-IDF algorithm, and the calculation formula is \(tf-idf(t,d)=tf(t,d)\timesidf(t)\) (where \(tf(t,d)\) is the frequency of occurrence of word t in document d, \(idf(t)=log(total number of documents / number of documents containing word t + 1)\)), and remove stop words with a weight lower than 0.01 (such as "Notice hereby", "CC unit").
[0030] 3. Feature Extraction Module: Based on a large model, deep semantic features of policy texts are extracted to construct an efficient knowledge index, supporting accurate retrieval and key information extraction. Technical implementation involves lightweight fine-tuning of the large model: Qwen-72B is selected as the base model, employing a LoRA lightweight fine-tuning strategy: 90% of the underlying Transformer parameters are frozen, and a low-rank adapter matrix ΔW∈R^16×4096 (rank r=16, hidden layer dimension d=4096) is added only to the top classifier and the middle four layers. The parameter update formula is \(W_{new}=W_{frozen}+\DeltaW\), reducing trainable parameters by 90%, lowering fine-tuning costs while improving domain adaptability. Then, a knowledge index is constructed. The knowledge base text is segmented using the Jieba tool, establishing a "keyword → document ID list" mapping to support fast text matching. Vector indexing: Sentence-BERT is used to generate 768-dimensional semantic vectors, and Faiss is used to construct a vector index, enabling efficient semantic similarity retrieval of policy texts.
[0031] 4. Key Information Identification Module: Candidate knowledge is acquired through a Retrieval Enhancement Generation (RAG) mechanism, and combined with dynamic weight ranking and entity recognition models to accurately extract core policy information. The technology implements a hybrid retrieval engine: a two-layer retrieval strategy is executed. First, the top 20 text matching results are returned through an inverted index, and then the top 20 semantically similar results are returned through Faiss vector search. After merging and deduplication, 30 candidate knowledge items are retained as contextual support. Dynamic weight ranking: Candidate knowledge is ranked based on the formula \(Weight_{vector}=0.6×IntentScore(q)+0.4×Confidence(q)\), where: IntentScore determines the query type (factual = 1, open = 0) by fine-tuning the BERT-Mini model, and Confidence is the classification confidence score (0-1), ensuring that the retrieval results highly match the requirements. Entity extraction: A fine-tuned entity recognition model (F1 score of 0.95) is used to extract 12 types of core entity information, such as "policy name", "issuing authority", and "effective date", through BIO annotation formats (e.g., B-issuing authority, I-issuing authority).
[0032] 5. Information Verification Module: A multi-level verification system is constructed to verify extracted information from three dimensions: format compliance, business logic, and consistency of association, reducing the error rate to below 0.5%. Technical implementation includes basic format verification: Schema-based verification of field types and formats; for example, "Effective Date" must match the regular expression \((\d{4})-(\d{2})-(\d{2})\), automatically converting incorrect formats such as "2024 / 01 / 01" to standard formats; and verifying whether required fields such as "Issuing Authority" are missing, triggering manual completion prompts when missing fields are found. Business rule verification: Over 200 policy business rules (such as "Tax policies must include tax rate standards" and "Environmental protection policies must specify the implementing department") are loaded through the Drools rule engine. For content lacking a specific date, such as "This notice shall take effect from the date of issuance," the system automatically associates the issuance date to complete the effective date. Association logic verification: Use Neo4j to build a "policy-terms-revision" association graph to detect conflicts between old and new policy terms (such as the difference in tax exemption amount between the "2024 VAT preferential policy" and the "2023 policy"). Highlight conflict points and push the revision basis, and support manual confirmation and correction.
[0033] 6. Information Entry Module: This module implements categorized storage of verification information and constructs a dynamic optimization mechanism to ensure the long-term stability and accuracy of the system through weight adjustment and model iteration. Technical implementation includes categorized storage and log recording: structured information such as "policy clauses" is stored in a MySQL database, while unstructured information such as "policy interpretation documents" is stored in MongoDB; operation logs such as data collection time, preprocessing results, and verification status are recorded synchronously, supporting end-to-end traceability. Dynamic weight adjustment: retrieval weights are dynamically updated based on the Exponential Moving Average (EMA) algorithm, with the formula \(CurrentWeight=0.7×LastWeight+0.3×NewWeight\); the F1 score threshold window [0.92, 0.98] is monitored in real time, and weight adjustment is automatically triggered when F1 < 0.92. Continuous model iteration: The LoRA adapter is incrementally fine-tuned quarterly using newly labeled data (including manually reviewed error cases), retaining the historical best model version and supporting one-click rollback to ensure the model adapts to the latest policy data changes.
[0034] Example 3: Taking the "Notice of the State Council on Tax Preferential Policies for Small and Micro Enterprises in 2024" as an example, the specific implementation steps are as follows: S1, Data Acquisition and Preprocessing: S1.1, Multi-source heterogeneous data access Based on the multi-source acquisition architecture of the system input module, layered data acquisition is performed for the "Notice of the State Council on Tax Preferential Policies for Small and Micro Enterprises in 2024" (hereinafter referred to as the "Target Document"). Data access for the internal government system: Connect to the State Council's policy management system through the RESTful API interface, configure a 30-minute polling mechanism to monitor newly released documents in real time. When a target document is detected, the system automatically calls the interface to obtain the document metadata (title, release time, document number, etc.) and the full text content, and triggers a three-time automatic retry mechanism to ensure stability. If the interface call fails, an alarm message is pushed via email.
[0035] Supplemental verification of public network resources: Simultaneously start the Scrapy framework combined with the Selenium tool to dynamically crawl the "Policy Documents" column on the State Council's official website. Locate the download link of the target document through XPath, configure 10 proxy IPs for polling and a 5-second request interval to avoid access restrictions; for the dynamically loaded policy interpretation content on the page, complete the full collection through Selenium's simulated scrolling operation.
[0036] Retrieval of associated historical data: Directly connect to the enterprise's policy archive MySQL database through the JDBC protocol. Based on the table partitioning strategy of "release year + domain" (such as "2023_Fiscal Policy", "2022_Tax Policy"), batch extract 1,000 historical records of small and micro enterprise tax policies (such as the preferential policy documents in the 2023 version) to provide data support for subsequent associated verification.
[0037] S1.2, Adaptive preprocessing and cleaning: Perform standardized conversion on the target document based on the format processing logic of the preprocessing module: Format recognition and conversion: Classify the format of the target document through the BERT-base model and calculate the format recognition probability P(F). After detection, if the target document is a text-based Word document (P(text-based)=0.96≥0.9), directly extract the text content; if it is a scanned PDF (image-based), trigger Tesseract OCR recognition and call the text correction model in the power field to repair recognition errors such as "2024 year"; if it contains a table (mixed type), extract the text through PyPDF2, parse the table with Camelot and convert it to CSV format.
[0038] Duplicate removal and noise filtering: Calculate the unique identifier of the target document using the SHA-256 hash algorithm (Hash = SHA256(full text content + title + release date)), compare it with the existing hash values in the database, and retain it after confirming no duplicates; filter redundant content based on the TF-IDF algorithm, calculate the weights of stop words such as "CC: Tax bureaus of all provinces, municipalities and autonomous regions" and "This notice is hereby given" (both <0.01), automatically remove the noise text, and retain the core policy terms.
[0039] S2, Feature extraction and model fine-tuning: S2.1, LoRA lightweight fine-tuning of the Qwen-72B model: To meet the needs of policy-related tasks, a lightweight fine-tuning was performed on the Qwen-72B large model: Fine-tuning strategy implementation: Freeze 90% of the parameters of the bottom layer Transformer, add low-rank adapter matrices only to the top classifier and the middle 4 layers, and optimize the model according to the parameter update formula.
[0040] Training data and results: The model was trained using BIO labeled data (training set: validation set: test set = 7:2:1) containing 12 types of entities such as "policy name" and "issuing authority". After fine-tuning, the model's entity recognition F1 score reached 0.95, which meets the accuracy requirements for policy entity extraction.
[0041] S2.2, Knowledge Index Construction: A dual index is built for the target documents and historical policy data: Inverted Index: By segmenting text using the Jieba tool, a mapping list is created between keywords such as "micro and small enterprises," "value-added tax," and "preferential policies" and document IDs, supporting fast text matching.
[0042] Vector Index: Use Sentence-BERT to generate a 768-dimensional semantic vector for the target file, and build a vector index using Faiss to achieve semantic similarity retrieval with historical policies (such as quickly matching "2023 tax policy for small and micro enterprises").
[0043] S3, Key Information Identification: Based on the key information identification module, the retrieval enhancement mechanism accurately extracts the core information of the target file: S3.1, Hybrid retrieval to obtain candidate knowledge: Perform a two-tiered search on queries related to the target document (such as "2024 tax incentives for small and micro enterprises"). First, return the top 20 text matching results (such as policy clauses containing the keywords "small and micro enterprises + value-added tax") through the inverted index; Then, the Faiss vector search returns the Top 20 semantically similar results (such as the historical "tax incentive policy revision clause"). After merging and deduplication, 30 candidate knowledge entries are retained as contextual support for entity extraction.
[0044] S3.2, Dynamic Sorting and Entity Extraction: Dynamic weight ranking: Candidate knowledge weights are calculated based on a formula. The target file query is factual (IntentScore=1), and the model classification confidence score is 0.97. The top 5 knowledge items are selected by weight and combined into the context.
[0045] Entity extraction: After fine-tuning the model (F1=0.95), 12 types of entities were extracted using the BIO annotation format, ultimately obtaining key information such as the policy name "Notice of the State Council on Tax Preferential Policies for Small and Micro Enterprises in 2024", the issuing authority "State Council", the effective date "2024-01-01", and the core clause "Monthly sales of less than 100,000 yuan are exempt from value-added tax".
[0046] S4, multi-level verification: A three-level verification system based on the information verification module performs comprehensive verification of the extracted information: S4.1, Basic Format Validation: Verify field compliance via schema: Check if the "Effective Date" format matches the regular expression (\d{4})-(\d{2})-(\d{2}). The target file date "2024-01-01" passes the validation. If it encounters incorrect formats such as "2024 / 01 / 01", it will be automatically converted to the standard format.
[0047] Verify that required fields such as "Issuing Authority" and "Policy Name" are not missing. If the target file has no missing fields, proceed to the next verification step.
[0048] S4.2, Business Rule Validation: Validation logic for 200+ policy rules is loaded using the Drools rule engine: The rule "tax policy must include tax rate standards" was triggered, and the target document was found to contain the clause "monthly sales of less than 100,000 yuan are exempt from value-added tax", which complies with business specifications; If a specific date is missing, such as "This notice shall take effect from the date of its issuance," the "issuance date" will be automatically added to complete the effective date.
[0049] S4.3, Association Logic Verification: Detect conflicts by building and setting up a "policy-terms-revision" relationship graph using Neo4j: Comparing the target document with the 2023 policy, it was found that the "exemption from taxation for monthly sales of 100,000 yuan" and the "exemption from taxation for monthly sales of 60,000 yuan" in the 2023 version are revised but have no logical conflict. If there are conflicts in the terms (such as contradictions in tax rates between old and new policies), the conflict points will be highlighted and the basis for revision will be pushed out, supporting manual confirmation.
[0050] S5, Information Input and Continuous Optimization: Based on the storage and optimization mechanism of the information entry module, a closed-loop process is completed: S5.1, Categorized Storage and Log Recording: Structured information such as "policy name" and "effective date" is stored in a MySQL database, while unstructured information such as the full text of the policy and interpretation documents is stored in MongoDB. It synchronously records operation logs such as data acquisition time, preprocessing results, and verification status, supporting full-chain traceability.
[0051] S5.2, Dynamic Optimization and Model Iteration: Retrieval weight adaptive adjustment: Retrieval weights are dynamically updated based on the EMA algorithm, and the F1 score threshold window [0.92, 0.98] is monitored in real time. If the F1 score of the target file is lower than 0.92, weight adjustment is automatically triggered. The specific formula is as follows: ; Each quarter, the LoRA adapter is incrementally fine-tuned using newly labeled data, retaining the best historical model version and supporting one-click rollback; target file-related data is included in the fine-tuning dataset for the next quarter to continuously improve model accuracy.
[0052] S5.3, Compilation and Application of Results: The verified information is compiled and categorized by the "Taxation Field - 2024" dimension, generating editable Word documents and online web pages. Users can view the original text of policy provisions, revision history (such as comparison with the 2023 version of the policy), and verification reports through the web interface, enabling efficient retrieval and management of policy information.
Claims
1. A document information automatic entry system based on a large language model, characterized in that, The system includes: The input module is used to access multi-source policy data, including polling internal government system data through a RESTful API interface, scraping public network resources through the Scrapy framework combined with the Selenium tool, and extracting data in batches by directly connecting to historical databases through the JDBC protocol. The preprocessing module is used to perform format recognition and conversion, deduplication and noise filtering on policy data. This includes classifying text, image and mixed files based on the BERT-base model, using OCR to recognize and correct image files in combination with domain models, deduplicating using the SHA-256 hash algorithm, and filtering low-weight redundant content based on the TF-IDF algorithm. The feature extraction module is used to extract policy text features, including extracting semantic features using the Qwen-72B model with LoRA lightweight fine-tuning, constructing an inverted index through Jieba word segmentation, generating vectors based on Sentence-BERT and constructing a vector index through Faiss; The key information identification module is used to identify key policy information, including obtaining candidate knowledge using a hybrid retrieval engine and based on a dynamic weight formula. The system sorts and extracts information on multiple policy entities using an entity recognition model with BIO annotation format. The information verification module is used to verify the extracted key information, including basic format verification based on schema, business rule verification based on Drools rule engine, and logical consistency verification based on Neo4j association graph. The information entry module is used to classify and store verified information into the database, record operation logs, dynamically adjust retrieval weights based on the EMA algorithm, and fine-tune the model every quarter by adding new data increments.
2. The document information automatic entry system based on a large language model according to claim 1, characterized in that, The input module is configured with an interface retry mechanism, network crawling proxy IP polling and request interval control, and historical data is extracted using a "release year + domain" table partitioning strategy.
3. The document information automatic entry system based on a large language model according to claim 1, characterized in that, The format conversion in the preprocessing module includes: for image files, using TesseractOCR to identify and combine with a domain text correction model to fix errors; for mixed files, using PyPDF2 to extract text, Camelot to parse tables and convert to CSV format.
4. The document information automatic entry system based on a large language model according to claim 1, characterized in that, The LoRA fine-tuning strategy in the feature extraction module is as follows: Freeze the parameters of the Qwen-72B's underlying Transformer and add a low-rank adapter matrix to the top classifier and the middle four layers. The parameter update formula is: ; in, It is the adapter matrix after freezing the underlying Transformer parameters.
5. The document information automatic entry system based on a large language model according to claim 1, characterized in that, In the key information identification module, the IntentScore of the dynamic weight formula determines the query type by fine-tuning the BERT-Mini model, with factual type = 1 and open type = 0; Confidence is the model's confidence in the query classification, with a value range of 0-1.
6. The method for automatic document information entry based on a large language model according to any one of claims 1-5, characterized in that, Includes the following steps: Access policy data from multiple sources, obtain data through API interfaces, web scraping and direct database connections, and configure retry and proxy mechanisms to ensure stability; Preprocess the data by identifying and converting file formats based on the BERT-base model, and then using SHA-256 hashing for deduplication and TF-IDF algorithm for noise filtering. Text features are extracted, and a feature system is constructed using the LoRA-tuned Qwen-72B model, inverted index, and vector index. Identify key information, acquire candidate knowledge through hybrid retrieval and sort it based on dynamic weights, and extract multi-type entity information using BIO annotation format; Multi-level verification information performs basic format verification, business rule verification, and related logic verification, triggering manual correction prompts. Enter and optimize information, categorize and store information in the database, record logs, adjust retrieval weights based on the EMA algorithm, and incrementally fine-tune the model every quarter.
7. The method for automatic document information entry based on a large language model according to claim 6, characterized in that, The formula for calculating TF-IDF in the preprocessing is: ,in Let t be the frequency of word t in document d. .
8. The method for automatic document information entry based on a large language model according to claim 6, characterized in that, The basic verification in the multi-level verification is performed using regular expressions. Verify the effective date format; automatically complete missing information when loading multiple policy rules for business rule validation; and detect policy clause conflicts through the Neo4j graph database for correlation validation.
9. A computer device, characterized in that, It includes a memory and a processor, which are interconnected and communicate with each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the document information automatic entry method based on a large language model as described in any one of claims 6 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the document information automatic entry method based on a large language model as described in any one of claims 6 to 8.
Citation Information
Patent Citations
Truck radial tire with full-contact steel wire ring and winding disc of truck radial tire
CN113199911A
Method and apparatus for a fast access considering service assistant information in a wireless communication system
US20220124567A1