A method and system for extracting union fund collection information based on a large language model
Through the information extraction method based on the large language model and the HBaseX-Pack database, the efficiency and security issues in data exchange between the tax system and the trade union system were solved, and efficient and secure processing and analysis of trade union fund collection data was achieved.
Patent Information
- Application Number
- CN202510780213.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2045-06-12
AI Technical Summary
In existing technologies, the data exchange efficiency between the tax system and the trade union system is low, and data consistency and security are difficult to ensure, which affects the quality and efficiency of trade union fund collection work.
An information extraction method based on a large language model is adopted. By designing multi-level prompt words and noise node judgment, combined with the HBaseX-Pack distributed database and digital envelope technology, efficient data processing and secure transmission are achieved.
It improves data processing efficiency, ensures data consistency and security, reduces data loss and errors, can quickly identify underpaid units and push reminders, and improves the quality and efficiency of union fund collection.
Smart Images

Figure CN120296799B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information extraction, and relates to a method and system for extracting union fund collection information based on a large language model. Background Art
[0002] Tax registration units declare and pay union funds through the tax collection system. At the end of each month, the union, tax authorities, and banks reconcile their accounts and transfer the collected funds. Currently, the tax collection of union fund data mainly relies on the communication of each city's tax and union departments through the regular transmission of Excel spreadsheets. Under this method, the collection data is not transmitted in a timely manner, and it is impossible to conduct a systematic and comprehensive analysis and application of the collection data, which affects the quality and efficiency of the union fund collection work. Problems in the application: the data exchange between the union system and the tax system is large, and it is impossible to process big data efficiently and quickly; the data consistency between the union system and the tax system is too much, and too many intermediate links can easily lead to data loss or errors; the data transmission security between the union system and the tax system is of paramount importance. If the data is obtained by criminals, it can easily lead to serious consequences. Summary of the Invention
[0003] In order to solve the technical problems existing in the above background technology, in a first aspect, the present invention provides a method for extracting union fund collection information based on a large language model, comprising:
[0004] Obtain the funding data file and store it using database tools, then use the extraction tool to extract the funding text from the funding data file. For the funding data file, an Excel spreadsheet is used. Before extracting the funding text information, the document in the Excel spreadsheet must first be converted into an LA-DOM tree structure. Then, noise nodes are determined based on the attributes of each node in the LA-DOM tree and the statistical information of its subtrees, and finally the main information is extracted.
[0005] Designing first-level prompt words, inputting the first-level prompt words and main information into a preset large language model, and the large language model outputting key information of the expense text under the guidance of the first-level prompt words;
[0006] For each fund in the key information of the fund text, a second-level prompt word is designed. The second-level prompt word includes the fund name and the corresponding fund category. The second-level prompt word is input into the large language model. The large language model outputs the fund category coding result of each fund under the guidance of the second-level prompt word.
[0007] Furthermore, for each expense in the key information of the expense text, a second-level prompt word is designed, wherein the second-level prompt word includes the expense name and the corresponding expense category, and the second-level prompt word is input into the large language model.
[0008] Furthermore, the large language model outputs the funding category coding results of each funding under the guidance of the second-level prompt words, including:
[0009] Construct a mapping relationship table from fund name to fund category, fund category to code, and fund name to code; based on the mapping relationship table, design a second-level prompt word for each fund in the key information of the fund text; input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result for each fund under the guidance of the second-level prompt word.
[0010] Furthermore, for funds for which the large language model cannot output the funding category coding results, a broader third-level prompt word is repeatedly designed and input into the large language model until the large language model can output the funding category coding results of the remaining funds under the guidance of the third-level prompt word; the funding category coding results of each fund output by the large language are post-processed; the key information of the funding text and the funding category coding results of each fund are data integrated and output.
[0011] In a second aspect, the present invention provides a system for extracting union fund collection information based on a large language model, comprising:
[0012] The funding data acquisition module is configured to: acquire funding data files and store them using a database tool, and extract funding text from the funding data files using an extraction tool;
[0013] The key information extraction module is configured to: design a first-level prompt word, input the first-level prompt word and main information into a preset large language model, and the large language model outputs the key information of the expense text under the guidance of the first-level prompt word;
[0014] The data classification module is configured to: design a second-level prompt word for each fund in the key information of the fund text, the second-level prompt word including the fund name and the corresponding fund category, input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result of each fund under the guidance of the second-level prompt word.
[0015] The beneficial effects of the present invention are:
[0016] 1. The present invention provides a method for extracting union fund collection information based on a large language model. The method obtains fund data files and stores them using database tools, and extracts fund text from the fund data files using extraction tools. Excellent database tools are selected for fund data storage, and the HBaseX-Pack distributed columnar database is selected. Massive data is partitioned and a wide range of indexes are established to solve the problem of system jamming due to excessive amount of data pushed at one time. The pushed data is placed in the message middleware for peak shaving processing. The data is stored in the log file without any processing to prevent loss due to data processing. The system can configure the concurrency according to the server performance to perform warehousing operations.
[0017] 2. This invention employs a database server communicatively coupled to a database storing multiple data records. The front end retrieves metadata through a central metadata retrieval interface, which then uses metadata plug-in management to locate an appropriate metadata plug-in to retrieve the corresponding technical metadata. This solution ensures metadata consistency and timely access to metadata changes. This solution reduces information errors caused by inconsistent metadata and information lags caused by untimely changes and inability to retrieve them. It also addresses the issue of unified data standards, ensuring consistency among the tax system, the union's actual operations, and the system itself. Otherwise, data loss may occur due to inconsistent standards.
[0018] 3. The present invention designs first-level prompt words, inputs the first-level prompt words and main information into a preset large language model, and under the guidance of the first-level prompt words, the large language model outputs the key information of the funding text, and classifies and obtains the funding information, which can effectively analyze the underpaid units and non-paid units. It is necessary to determine the payment period according to the nature of the unit, and then calculate the payable amount based on the payment amount, payment date and total salary of the unit. After comparison and analysis, the underpaid units, underpaid amounts and non-paid units are obtained, and the list is pushed to the tax system for reminder.
[0019] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0021] Figure 1 This is a flowchart of a method for extracting union fund collection information based on a large language model according to the present invention. DETAILED DESCRIPTION
[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used in this embodiment have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0024] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0025] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention, and should not be understood as limiting the present invention.
[0026] In the present invention, terms such as "fixed connection," "connected," and "connection" should be interpreted broadly to mean a fixed connection, an integral connection, or a detachable connection; a direct connection or an indirect connection through an intermediary. Relevant researchers or technicians in this field may determine the specific meanings of these terms in the present invention based on specific circumstances, and they should not be construed as limitations of the present invention.
[0027] Example 1, as Figure 1 As shown, this embodiment provides a method for extracting union fund collection information based on a large language model, including:
[0028] Obtain the funding data file and store it using database tools, and extract the funding text from the funding data file using extraction tools;
[0029] Designing first-level prompt words, inputting the first-level prompt words and main information into a preset large language model, and the large language model outputting key information of the expense text under the guidance of the first-level prompt words;
[0030] For each expense in the key information of the expense text, a second-level prompt word is designed, wherein the second-level prompt word includes the expense name and the corresponding expense category, and the second-level prompt word is input into the large language model. The large language model outputs the expense category coding result of each expense under the guidance of the second-level prompt word; for each expense in the key information of the expense text, a second-level prompt word is designed, wherein the second-level prompt word includes the expense name and the corresponding expense category, and the second-level prompt word is input into the large language model. The large language model outputs the expense category coding result of each expense under the guidance of the second-level prompt word.
[0031] Construct a mapping relationship table from fund name to fund category, fund category to code, and fund name to code; design a second-level prompt word for each fund in the key information of the fund text based on the mapping relationship table; input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result of each fund under the guidance of the second-level prompt word; for funds for which the large language model cannot output the fund category coding result, repeatedly design a broader third-level prompt word and input it into the large language model until the large language model can output the fund category coding result of the remaining funds under the guidance of the third-level prompt word; post-process the fund category coding result of each fund output by the large language;
[0032] The key information of the funding text and the funding category coding results of each funding are integrated and output.
[0033] Among them, the funding data file is obtained and stored using database tools, and the funding text is extracted from the funding data file using extraction tools. Specifically: funding data files are usually communicated in the form of transmitting Excel tables. The focus of extracting information from Excel tables is on how to efficiently extract large amounts of data while ensuring timely and effective data transmission. Noise judgment and subject information judgment are established, and noise information and subject information are identified based on statistical data. Information extraction is performed through feature marking methods of noise and subject information.
[0034] Funding data files typically contain information such as title, time, region, area code, expenditure amount, and ID. Other irrelevant information, such as project descriptions and notes, is referred to as "noise information." Noise information is unnecessary and, from the perspective of information extraction, has no value. Before extracting funding text information, the Excel spreadsheet document must first be converted into an LA-DOM tree structure. Noise nodes are then identified based on the attributes of each LA-DOM tree node and the statistical information of its subtrees, ultimately extracting the main information. Converting the Excel spreadsheet document to LA-DOM primarily involves two steps: node generation and node attribute addition.
[0035] The node generation process categorizes node tags into LA-DOM nodes, and converts attribute tags into attribute values. The content of the Excel spreadsheet to be processed is passed to the conversion program as a string. The conversion program scans the string from beginning to end. When a node tag's start tag is encountered, a node is generated and added to the child nodes of the current node. The current node pointer moves down, and the newly generated node becomes the current node. When the node tag's end tag is encountered, the current node pointer moves back up to point to the current node's parent node. When an attribute tag is encountered, it is added to the current node as a node attribute along with the other attributes of the node tag.
[0036] The attribute stack is generated during the LA-DOM tree node generation process and destroyed when the LA-DOM tree is complete. Its purpose is to record the attributes of nodes at each level and ultimately assign these attributes to text nodes, serving as a basis for subsequent analysis. The attribute stack generation rule is as follows: upon encountering the start tag of a node tag, an attribute element is generated simultaneously with the generation of a hierarchical node. This attribute element first copies the top attribute of the attribute stack, then appends the new attribute to the attribute element, and finally pushes the attribute element onto the stack. Upon encountering the end tag of a node tag, the top element of the attribute stack is popped when the current node pointer backtracks. Upon encountering a text node, the top element of the attribute stack is assigned as an attribute to the text node and is not popped. Following this rule, when the LA-DOM tree is complete, all text nodes have been assigned attribute values according to their hierarchical relationship, and the attribute stack is now empty.
[0037] The algorithm process for converting documents in Excel spreadsheets to LA-DOM trees is as follows: if (starting tag) {if (is a node tag) {generate a new node; extract tag attributes, enter the attribute stack; add the node as a subtree of the current node of the DOM tree; the current node points to the new node}; elseif (is an attribute tag) {record attributes, enter the attribute stack}; else{irrelevant tags, skip directly}; elseif (is an ending tag) {if (is a node tag) {pop the top element of the attribute stack; backtrack to find a matching start tag; if (find a matching start tag) {close the tag; set it to the current node} else{redundant tags, skip directly}}; else{not a node tag, skip directly}}; else{ / / text information; generate a text node; add the top attribute of the attribute stack to the text node; add the leaf node as a child of the current node of the DOM tree}.
[0038] After completing the conversion of the document in the Excel table to the LA-DOM tree, it is necessary to mark the noise nodes, which is also the core part of the funding information extraction and directly affects the accuracy of the information extraction results.
[0039] In the nodes of the LA-DOM tree, statistical information such as the number of directly non-connected sub-leaf nodes, the number of directly non-connected sub-leaf nodes, the number of directly connected sub-leaf nodes, the number of directly connected sub-leaf nodes, the total number of connected child nodes, the total number of connected child nodes characters, the total number of non-connected child nodes, and the total number of non-connected child nodes characters are added. Noise nodes are marked based on these statistical information.
[0040] The statistical information within a node is named as follows: DLN: Number of directly linked child nodes. DLT: Number of characters in directly linked child nodes. DUN: Number of directly unlinked child nodes. DUT: Number of directly unlinked child nodes. TLN: Total number of linked child nodes. TLT: Total number of characters in linked child nodes. TUN: Total number of unlinked child nodes. TUT: Total number of characters in unlinked child nodes. Text containing links is often considered noise information on news webpages, while large amounts of unlinked text are often considered financial information. DLN, DLT, TLN, and TLT are collectively referred to as noise features, while DUN, DUT, TUN, and TUT are collectively referred to as information features. The larger the information feature value of a node, the more likely it is to be the main news item; conversely, the larger the noise feature value, the more likely it is noise information.
[0041] The algorithm for building node statistics is as follows:
[0042] postTraversal(NodecurrentNode){
[0043] if (has child nodes) {
[0044] Node child = currentNode.getFirstChild(); postTraversal(child);
[0045] while (child.hasNextSibling) {
[0046] child = child.getNextSibling();
[0047] postTraversal(child);}
[0048] The noise node judgment rules are designed as follows:
[0049] (1) When DUN = 0 and DUT = 0, that is, when the number of direct non - linked child nodes or the number of characters of non - linked child nodes is 0, which means there are no non - linked text nodes under the current node, it is judged as a noise node.
[0050] (2) When DLT >= DUT, that is, when the number of characters of direct linked child nodes is greater than the number of characters of direct non - linked child nodes, it is judged as a noise node because in the main body of the funds text, most of the text is non - linked text.
[0051] (3) When DLN * a > DUN, that is, when the number of direct linked child nodes is greater than the number of direct non - linked child nodes, it is judged as a noise node. a is an adjustment factor, and according to statistics, when the value is 2.6, the judgment is more accurate.
[0052] (4) When DLT / DLN > DUT / DUN, that is, when the ratio of the number of characters of direct linked child nodes to the number of direct linked child nodes is greater than the ratio of the number of characters of direct non - linked child nodes to the number of direct non - linked child nodes, it is judged as a noise node.
[0053] (5) When DUT / DUN < threshold, that is, when the value of DUT / DUN is less than a certain threshold, it is judged as noise. According to the previous statistics, when threshold takes the value of 9.7, the effect is better.
[0054] For the funds pictures and the pictures converted from the scanned copies in PDF files, the following is a schematic flow diagram of the method for identifying the funds text in the funds pictures and the pictures converted from the scanned copies in PDF files in the embodiments of the present application. This method at least includes the following steps:
[0055] Pre - process the pictures. First, use non - local means denoising to reduce the noise in the pictures and retain the clarity of the text. Subsequently, use the following formula to enhance the contrast and brightness of the pictures:
[0056]
[0057] Among them, is the pixel value of the image after contrast and brightness enhancement processing, is the pixel value of the original image, and are the minimum and maximum pixel values of the image, respectively. α and β are adjustment parameters used to adjust the contrast and brightness.
[0058] Local Binary Pattern (LBP) is a method for describing the local texture features of an image. For each pixel, a binary number is generated by comparing its grayscale value with that of the surrounding pixels, and then the LBP value is obtained.
[0059] For each text region, possible characters can be extracted using methods based on pixel intensity and shape features, either through connected component analysis or pixel-based operations. Specific methods include: connecting pixels in the text region to form character shapes and determining character boundaries based on the relative positions and intensities of the pixels. Characters are extracted by detecting specific patterns or outlines in the character shapes. Simple pattern matching or rule matching is performed on the extracted characters. For example, basic rules can be defined to identify numbers, letters, or specific symbols. These rules can determine character identity based on their shape, size, and pixel distribution. The identified and extracted characters are reconstructed into complete text lines or paragraphs according to their layout order in the image. This is accomplished by connecting the characters and sorting them according to their position in the image. Finally, the reconstructed text lines or paragraphs are combined to form the entire image's budget text. The budget text can be organized into lines or paragraphs and output as a text string.
[0060] For the storage of financial data, we selected excellent database tools, including the HBaseX-Pack distributed columnar database. We partitioned massive amounts of data, established extensive indexes, and established a caching mechanism. We sampled data, conducted data mining, and stored massive amounts of data in an associative manner. HBaseX-Pack provided high-performance random read and write operations. Daily, we aggregated and synchronized the previous day's data and archived it to other low-performance but low-cost databases. The selected HBaseX-Pack is a low-cost, one-stop data processing platform built on HBase and the HBase ecosystem. HBaseX-Pack supports HBaseAPI (including RestServerThriftServer), relational PhoenixSQL, time-series OpenTSDB, full-text Solr, spatiotemporal GeoMesa, graph HGraph, and analysis SparkonHBase. HBaseX-Pack can achieve a closed-loop data process from processing, storage, to analysis. To solve the problem of system jamming caused by excessive amount of data pushed at one time, push data is placed in the message middleware for peak shaving processing. The data is stored in the log file without any processing to prevent loss due to data processing. The system can configure the concurrency according to the server performance for warehousing operations.
[0061] The database server is communicatively coupled to a database storing multiple data records. These data records are accessible by multiple data access systems communicatively coupled to the database server. The front end retrieves metadata through a central metadata retrieval interface. The central metadata retrieval interface finds an appropriate metadata plug-in through metadata plug-in management to obtain corresponding technical metadata. The central metadata retrieval interface obtains management metadata and business metadata by querying the metadata management system DB. The central metadata retrieval interface summarizes the metadata and returns it to the front end. Metadata retrieval is performed based on the central metadata retrieval interface, and data is assembled in the retrieval interface. The assembled metadata is returned to the front end for rendering. This solution ensures metadata consistency and timely acquisition of metadata changes. This solution reduces information errors caused by inconsistent metadata and information lags caused by untimely changes that cannot be acquired. The issue of unified caliber is to ensure that the data caliber of the tax system, the actual business of the trade union, and this system is consistent. Otherwise, data loss due to inconsistent caliber may occur.
[0062] The problem of missed push can be avoided by counting the total number of pushed data, the total number of stored data, and the total number of tax pushed data. If the data is consistent, missed push can be avoided. If missed push occurs, it is necessary to quickly locate the specific data that is missed. The quick location can be completed by hashing the payment amount + payment unit + payment year and comparing it with the pushed data.
[0063] To analyze underpaid and non-paid units, it is necessary to determine the payment period based on the nature of the unit, and then calculate the payable amount based on the payment amount, payment date and total wages of the unit. After comparison and analysis, the underpaid units, underpaid amounts and non-paid units are obtained, and the list is pushed to the tax system for reminder.
[0064] Much of the information transmitted within business systems is sensitive. Therefore, it must be protected from unauthorized access and tampering when transmitted online. Therefore, transmission encryption is essential. Secure encryption of information transmission can be achieved using digital envelope technology. Digital envelopes utilize both single-key and public-key cryptography. Digital envelope technology involves the sender first encrypting the information using a symmetric cipher, then using the recipient's public key to encrypt the symmetric cipher before sending it to the recipient. To decrypt the information, the recipient must first decrypt the symmetric cipher using their private key. Only then can the symmetric cipher be used to decrypt the information.
[0065] To ensure the security of transmitted information, the symmetric key used for each transmission must be different. Digital envelope technology was developed to address this issue. Combining the advantages of symmetric and public key encryption, digital envelope technology overcomes the difficulties of symmetric key distribution and the lengthy encryption time associated with public key encryption. Using two levels of encryption, it achieves the flexibility of public key technology with the efficiency of symmetric key technology. With digital envelope technology, even if an encrypted file is illegally intercepted, decryption is impossible.
[0066] Example 2
[0067] This embodiment provides a system for extracting union fund collection information based on a large language model, including:
[0068] The funding data acquisition module is configured to: acquire funding data files and store them using a database tool, and extract funding text from the funding data files using an extraction tool;
[0069] The key information extraction module is configured to: design a first-level prompt word, input the first-level prompt word and main information into a preset large language model, and the large language model outputs the key information of the expense text under the guidance of the first-level prompt word;
[0070] The data classification module is configured to: design a second-level prompt word for each fund in the key information of the fund text, the second-level prompt word including the fund name and the corresponding fund category, input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result of each fund under the guidance of the second-level prompt word.
[0071] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for extracting union fund collection information based on a large language model, characterized in that: include: Obtain the funding data file and store it using database tools, and extract the funding text from the funding data file using extraction tools; For the funding data file, the Excel spreadsheet is used. Before extracting the funding text information, the document in the Excel spreadsheet must be converted into an LA-DOM tree structure. Then, noise nodes are judged based on the attributes of each node in the LA-DOM tree and the statistical information of its subtrees, and finally the main information is extracted. Designing first-level prompt words, inputting the first-level prompt words and main information into a preset large language model, and the large language model outputting key information of the expense text under the guidance of the first-level prompt words; For each expense in the key information of the expense text, a second-level prompt word is designed, where the second-level prompt word includes the expense name and the corresponding expense category, and the second-level prompt word is input into the large language model. The large language model outputs the expense category coding result of each expense under the guidance of the second-level prompt word; The node generation process is based on the label classification, generating LA-DOM nodes from node labels, and converting attribute labels into attribute values; the document content in the Excel table to be processed is passed into the conversion program as a string, and the conversion program scans the string from beginning to end. When encountering the start label of the node label, a node is generated and added to the child node of the current node. At the same time, the current node pointer moves down and the newly generated node is used as the current node; when encountering the end label of the node label, the current node pointer backtracks to point to the parent node of the current node; when encountering an attribute label, it is added to the current node as a node attribute together with other attributes of the node label; The attribute stack is generated during the LA-DOM tree node generation process and is destroyed when the LA-DOM tree is built. Its function is to record the attributes of nodes at each layer and finally assign the attributes to text nodes as the basis for subsequent analysis. The attribute stack generation rule is as follows: when encountering the start tag of the node tag, an attribute element is generated while generating the hierarchical node. The attribute element first copies the top attribute of the attribute stack, then adds the current new attribute to the attribute element, and finally pushes the attribute element into the stack. When encountering the end tag of the node tag, the top element of the attribute stack is also popped out when the current node pointer is backtracked. When encountering a text node, the top element of the attribute stack is assigned to the text node as an attribute and is not popped out. According to this rule, when the LA-DOM tree is built, all text nodes have attribute values added according to the hierarchical relationship, and the attribute stack is empty at this time. The algorithm process of converting the document in the Excel table to the LA-DOM tree is as follows: if (starting tag) {if (is a node tag) {generate a new node; extract the tag attributes and put them into the attribute stack; add the node as a subtree of the current node in the DOM tree; The current node points to the new node}; elseif (it is an attribute label) {Record the attribute and push it onto the attribute stack}; else {Irrelevant label, skip directly}; elseif (it is an end tag) {if (it is a node tag) {Pop the top element of the attribute stack; Trace back to find the matching start tag; if (the matching start tag is found) {The tag is closed; Set it as the current node} else {Extra tag, skip directly}}; else {Not a node tag, skip directly}}; else { / / Text information; Generate a text node; Add the attribute at the top of the attribute stack to the text node; Add the leaf node as a child node of the current node in the DOM tree}; In the nodes of the LA-DOM tree, statistics such as the number of direct non-linked child leaf nodes, the number of characters in direct non-linked child leaf nodes, the number of direct linked child leaf nodes, the number of characters in direct linked child leaf nodes, the total number of linked child nodes, the total number of characters in linked child nodes, the total number of non-linked child nodes, and the total number of characters in non-linked child nodes are added. Based on these statistical information as the judgment criteria, noise nodes are marked; The statistical information in the node is named as follows: DLN: The number of direct linked child nodes; DLT: The number of characters in direct linked child nodes; DUN: The number of direct non-linked child nodes; DUT: Direct non-linked child nodes; TLN: The total number of linked child nodes; TLT: The total number of characters in linked child nodes; TUN: The total number of non-linked child nodes; TUT: The total number of characters in non-linked child nodes; The noise node judgment rule is designed as follows: (1) DUN = 0 DUT = 0 When the number of direct non-linked child nodes or the number of characters in non-linked child nodes is 0, that is, there are no non-linked text nodes under the current node, it is judged as a noise node; (2) DLT >= DUT When the number of characters in direct linked child nodes is greater than the number of characters in direct non-linked child nodes, it is judged as a noise node because in the main body of the funds text, most of the text is non-linked text; (3) DLN * a > DUN When the number of direct linked child nodes is greater than the number of direct non-linked child nodes, it is judged as a noise node; a is an adjustment factor; (4) DLT / DLN > DUT / DUN When the ratio of the number of characters in direct linked child nodes to the number of direct linked child nodes is greater than the ratio of the number of characters in direct non-linked child nodes to the number of direct non-linked child nodes, it is judged as a noise node; (5) DUT / DUN < threshold When the value of DUT / DUN is less than a certain threshold, it is judged as noise.
2. The method for extracting union fund collection information based on a large language model according to claim 1, characterized in that: For each fund in the key information of the funds text, a second-level prompt word is designed. The second-level prompt word includes the fund name and the corresponding fund category, and the second-level prompt word is input into the large language model.
3. The method for extracting union fund collection information based on a large language model according to claim 1, characterized in that: The fund category coding results of each fund output by the large language model under the guidance of the second-level prompt word include: Construct a mapping relationship table from fund name to fund category, fund category to code, and fund name to code; based on the mapping relationship table, design a second-level prompt word for each fund in the key information of the fund text; input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result for each fund under the guidance of the second-level prompt word.
4. The method for extracting union fund collection information based on a large language model according to claim 1, characterized in that: For funds for which the large language model cannot output the funding category coding results, repeatedly design broader third-level prompt words and input them into the large language model until the large language model can output the funding category coding results for the remaining funds under the guidance of the third-level prompt words; post-process the funding category coding results of each fund output by the large language model; The key information of the funding text and the funding category coding results of each funding are integrated and output.
5. A union fund collection information extraction system based on a large language model, characterized by: include: The funding data acquisition module is configured to: acquire funding data files and store them using a database tool, and extract funding text from the funding data files using an extraction tool; The key information extraction module is configured to: design a first-level prompt word, input the first-level prompt word and main information into a preset large language model, and the large language model outputs the key information of the expense text under the guidance of the first-level prompt word; The data classification module is configured to: design a second-level prompt word for each fund in the key information of the fund text, the second-level prompt word including the fund name and the corresponding fund category, input the second-level prompt word into the large language model, and the large language model outputs the fund category coding result for each fund under the guidance of the second-level prompt word; The node generation process is based on the label classification, generating LA-DOM nodes from node labels, and converting attribute labels into attribute values; the document content in the Excel table to be processed is passed into the conversion program as a string, and the conversion program scans the string from beginning to end. When encountering the start label of the node label, a node is generated and added to the child node of the current node. At the same time, the current node pointer moves down and the newly generated node is used as the current node; when encountering the end label of the node label, the current node pointer backtracks to point to the parent node of the current node; when encountering an attribute label, it is added to the current node as a node attribute together with other attributes of the node label; The attribute stack is generated during the LA-DOM tree node generation process and is destroyed when the LA-DOM tree is built. Its function is to record the attributes of nodes at each layer and finally assign the attributes to text nodes as the basis for subsequent analysis. The attribute stack generation rule is as follows: when encountering the start tag of the node tag, an attribute element is generated while generating the hierarchical node. The attribute element first copies the top attribute of the attribute stack, then adds the current new attribute to the attribute element, and finally pushes the attribute element into the stack. When encountering the end tag of the node tag, the top element of the attribute stack is also popped out when the current node pointer is backtracked. When encountering a text node, the top element of the attribute stack is assigned to the text node as an attribute and is not popped out. According to this rule, when the LA-DOM tree is built, all text nodes have attribute values added according to the hierarchical relationship, and the attribute stack is empty at this time. The algorithm process of converting the document in the Excel table to the LA-DOM tree is as follows: if (starting tag) {if (is a node tag) {generate a new node; extract the tag attributes and put them into the attribute stack; add the node as a subtree of the current node in the DOM tree; The current node points to the new node}; elseif (is an attribute tag) {record the attribute and put it into the attribute stack}; else{irrelevant tags, skip directly}; elseif (is an end tag) {if (is a node tag) {pop the top element of the attribute stack; backtrack to find the matching start tag; if (find a matching start tag) {close the tag; set it as the current node} else{redundant tags, skip directly}}; else{not a node tag, skip directly}}; else{ / / text information; generate a text node; add the top attribute of the attribute stack to the text node; add the leaf node as a child node of the current node in the DOM tree}; The statistical information of the number of directly non-linked sub-leaf nodes, the number of directly non-linked sub-leaf node characters, the number of directly linked sub-leaf nodes, the number of directly linked sub-leaf nodes characters, the total number of linked child nodes, the total number of linked child nodes characters, the total number of non-linked child nodes, and the total number of non-linked child node characters are added to the nodes of the LA-DOM tree. These statistical information are used as the judgment criteria to mark the noise nodes. The statistics in the node are named as follows: DLN: number of directly linked child nodes; DLT: number of directly linked child node characters; DUN: number of directly unlinked child nodes; DUT: number of directly unlinked child nodes; TLN: number of total linked child nodes; TLT: number of total linked child node characters; TUN: number of total unlinked child nodes; TUT: number of total unlinked child node characters; The noise node judgment rules are designed as follows: (1) DUN=0 DUT=0 When the number of direct non-link child nodes or the number of non-link child node characters is 0, that is, there is no non-link text node under the current node, it is judged as a noise node; (2) DLT>=DUT When the number of characters in the directly linked child node is greater than the number of characters in the directly non-linked child node, it is judged as a noise node because in the main body of the funding text, most of the text is non-linked text; (3) When the number of directly linked child nodes is greater than the number of directly unlinked child nodes, i.e., DLN * a > DUN, it is determined as a noise node; a is an adjustment factor; (4) When the ratio of the number of characters of directly linked child nodes to the number of directly linked child nodes is greater than the ratio of the number of characters of directly unlinked child nodes to the number of directly unlinked child nodes, i.e., DLT / DLN > DUT / DUN, it is determined as a noise node; (5) When the value of DUT / DUN is less than a certain threshold, it is determined as noise.
Citation Information
Patent Citations
Webpage denoising method
CN112347353A
Big language model-based invoice information extraction and invoicing category judgment method
CN118781621A