Document format conversion method, format conversion device, equipment, medium and product

By acquiring documents and general table templates, extracting content elements using language models, and generating converted table files, the problems of low efficiency in interpreting policy and regulatory documents and insufficient standardization are solved, achieving unified and efficient interpretation of documents.

CN120654658APending Publication Date: 2025-09-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510805775.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

In the existing technology, the interpretation of policy and regulatory documents is inefficient and lacks standardized processing methods, resulting in large differences in interpretation results among different staff members, making it difficult to complete within the stipulated time, especially in the financial industry and corporate documents.

Method used

By acquiring the document to be converted and the corresponding general table template, the system extracts content elements using a preset language model, fills the cells based on element tags, performs text parsing, and finally generates a converted table file in a preset format.

Benefits of technology

It enables unified and standardized processing of different types of documents, reduces the difficulty of interpretation and the cost of manual interpretation, and improves the efficiency of document interpretation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654658A_ABST
    Figure CN120654658A_ABST
Patent Text Reader

Abstract

The invention provides a document format conversion method, a format conversion device, equipment, a medium and a product, which can be applied to the technical field of data processing and artificial intelligence. The method comprises the steps that a to-be-converted document and a general table template corresponding to the to-be-converted document are obtained, and the general table template comprises a plurality of cells and element tags corresponding to the cells; processing the to-be-converted document by utilizing a preset language model to obtain a plurality of content elements; for each content element, determining an element label corresponding to the content element from the general table template, and filling the content element into a cell corresponding to the element label based on the element label to obtain an initial table; performing text analysis processing on the initial table to obtain table configuration information; and according to the form configuration information and the target form template in the preset format, generating a conversion form file in the preset format.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data processing and artificial intelligence technology, and specifically to a document format conversion method, a document format conversion device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] For policies and regulations in various industries, after relevant institutions release them, they need to be interpreted so that staff can grasp the key points of the documents in a timely manner. For example, policies in the financial industry and corporate documents.

[0003] Since the interpretation of documents in some industries requires highly professional staff, manual interpretation is not only inefficient and difficult to complete within the specified time, but also the file formats interpreted by different staff vary greatly, and there is a lack of more effective standardized processing methods. Summary of the Invention

[0004] In view of the above problems, the present application provides a document format conversion method, a document format conversion device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to a first aspect of the present application, a document format conversion method is provided, comprising:

[0006] Obtaining a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template includes a plurality of cells and an element label corresponding to each cell;

[0007] Processing the document to be converted using a preset language model to obtain multiple content elements;

[0008] For each of the content elements, determine the element tag corresponding to the content element from the general table template, and fill the content element into the cell corresponding to the element tag based on the element tag to obtain an initial table;

[0009] Perform text parsing on the above initial form to obtain form configuration information;

[0010] According to the above form configuration information and the target form template of the preset format, a conversion form file of the preset format is generated.

[0011] According to an embodiment of the present application, obtaining a document to be converted and a general form template corresponding to the document to be converted includes:

[0012] Determine the document type according to the document to be converted;

[0013] Based on the above document type, a general form template corresponding to the above document type is obtained from a template library.

[0014] According to an embodiment of the present application, the document to be converted is processed using a preset language model to obtain multiple content elements, including:

[0015] Extracting multiple document samples related to the document type from a document knowledge base based on the document type of the document to be converted;

[0016] generating target prompt words based on the plurality of document samples, the document to be converted, and the basic prompt words, wherein the target prompt words include event prompt words of the document type and attribute prompt words corresponding to the event prompt words;

[0017] The preset language model is used to extract information from the event prompt words and the attribute prompt words to obtain the plurality of content elements, wherein the content elements include element names corresponding to the event prompt words and element attributes corresponding to the attribute prompt words.

[0018] According to an embodiment of the present application, a target prompt word is generated based on the plurality of the above document samples, the above document to be converted, and the basic prompt word, including:

[0019] Sorting the plurality of document samples based on a preset sorting rule to obtain a plurality of sorted document samples;

[0020] The target prompt words are generated according to the sorted multiple document samples, the document to be converted and the basic prompt words.

[0021] According to an embodiment of the present application, the plurality of document samples are sorted based on a preset sorting rule to obtain a plurality of sorted document samples, including:

[0022] Performing vector conversion on each of the above document samples and the above document to be converted, respectively, to obtain multiple sample vectors and document vectors;

[0023] For each of the above document samples, calculate the vector similarity between the above sample vector and the document vector;

[0024] Based on the vector similarity of each of the above document samples, the multiple document samples are sorted to obtain multiple sorted document samples.

[0025] According to an embodiment of the present application, the above initial form is subjected to text parsing to obtain form configuration information, including:

[0026] For each row of cells in the initial table, concatenate the content elements in multiple cells in the row using a separator to obtain a piece of configuration information;

[0027] The form configuration information is generated based on the plurality of configuration information.

[0028] According to an embodiment of the present application, generating a conversion table file in the preset format according to the form configuration information and the target table template in the preset format includes:

[0029] Extract each configuration information from the above form configuration information;

[0030] For each of the above configuration information, split the above configuration information based on the separator to obtain multiple unit elements;

[0031] According to the type of the above-mentioned unit element, the above-mentioned unit element is filled into the cell corresponding to the type of the above-mentioned unit element in the above-mentioned target table template to generate the above-mentioned conversion table file.

[0032] A second aspect of the present application provides a document format conversion device, comprising:

[0033] An acquisition module, configured to acquire a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template includes a plurality of cells and an element label corresponding to each cell;

[0034] An extraction module, configured to process the document to be converted using a preset language model to obtain a plurality of content elements;

[0035] a filling module, configured to determine, for each of the content elements, an element tag corresponding to the content element from the general table template, and fill the content element into a cell corresponding to the element tag based on the element tag to obtain an initial table;

[0036] The parsing module is used to perform text parsing on the initial form to obtain form configuration information;

[0037] The generating module is used to generate the conversion table file in the above-mentioned preset format according to the above-mentioned form configuration information and the target table template in the preset format.

[0038] The third aspect of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.

[0039] The fourth aspect of the present application further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.

[0040] The fifth aspect of the present application further provides a computer program product, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor.

[0041] According to an embodiment of the present application, a document to be converted is processed using a preset language model to obtain multiple content elements. For each content element, an element tag corresponding to the content element is determined from a universal table template, and based on the element tag, the content element is filled into the cell corresponding to the element tag to obtain an initial table. The initial table is subjected to text parsing to obtain form configuration information; based on the form configuration information and a target table template in a preset format, a conversion table file in a preset format is generated. Since different types of universal table templates are used to convert the corresponding document to be converted into the initial table, and the conversion table file is converted into a unified format based on the initial table, unified and standardized processing of different types of documents to be converted is achieved, reducing the difficulty of interpreting the document to be converted and the cost of manual interpretation, thereby improving the efficiency of interpreting the document to be converted. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings, in which:

[0043] Figure 1 A diagram schematically illustrates an application scenario of a document format conversion method according to an embodiment of the present application;

[0044] Figure 2 A flowchart of a document format conversion method according to an embodiment of the present application is schematically shown;

[0045] Figure 3 The following schematically shows a flow chart of a method for extracting content elements according to an embodiment of the present application;

[0046] Figure 4 The following schematically shows a flow chart of a method for sorting document samples according to an embodiment of the present application;

[0047] Figure 5 A schematic diagram of a structure of a document format conversion device according to an embodiment of the present application is shown; and

[0048] Figure 6 A block diagram of an electronic device suitable for implementing the above method according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0049] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present application. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present application. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present application.

[0050] The terms used herein are only for describing specific embodiments and are not intended to limit this application. The terms "comprise," "include," etc. used herein indicate the presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0051] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0052] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0053] Interpreting policies and documents across various industries and sectors presents significant challenges. For example, interpreting policies regarding financial customer information is highly specialized and challenging, and the interpretation results cannot be fully standardized. Furthermore, regulatory compliance generally requires timelines, which can squeeze R&D and testing time during the demand phase, leading to delays in meeting deadlines and meeting quality standards. If adjustments to the details of the interpretation results are needed, the deeply customized pages cannot quickly handle these adjustments. Excessive adjustments can even lead to rework, increasing R&D costs.

[0054] In view of this, an embodiment of the present application provides a document format conversion method, format conversion device, equipment, medium and product, the method comprising: obtaining a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template comprises multiple cells and an element label corresponding to each cell; processing the document to be converted using a preset language model to obtain multiple content elements; for each content element, determining the element label corresponding to the content element from the general table template, and filling the content element into the cell corresponding to the element label based on the element label to obtain an initial table; performing text parsing on the initial table to obtain form configuration information; generating a conversion table file in a preset format based on the form configuration information and a target table template in a preset format.

[0055] It should be noted that the document format conversion method and document format conversion device provided in this application can be used in the financial field, such as banks and other financial institutions, and can also be used in any field other than the financial field, such as e-commerce and other fields. Therefore, the application field of the document format conversion method and document format conversion device provided in this application is not limited.

[0056] In the technical solution of this application, the user information involved (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0057] Figure 1 The following schematically illustrates an application scenario of the document format conversion method according to an embodiment of the present application.

[0058] like Figure 1 As shown, the application scenario 100 according to this embodiment may include format conversion of regulatory documents issued by a financial institution. A network 104 is used as a medium for providing a communication link between a first terminal device 101, a second terminal device 102, a third terminal device 103, and a server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0059] A user may use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to interact with a server 105 via a network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, or the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).

[0060] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0061] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.

[0062] It should be noted that the document format conversion method provided in the embodiment of the present application can generally be executed by the server 105. Accordingly, the document format conversion device provided in the embodiment of the present application can generally be set in the server 105. The document format conversion method provided in the embodiment of the present application can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the document format conversion device provided in the embodiment of the present application can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0064] Figure 2 The flowchart of the document format conversion method according to an embodiment of the present application is schematically shown.

[0065] like Figure 2 As shown, the document format conversion method of this embodiment includes operations S210 to S250, and the transaction processing method can be executed by an electronic device.

[0066] In operation S210 , a document to be converted and a general table template corresponding to the document to be converted are obtained, wherein the general table template includes a plurality of cells and an element tag corresponding to each cell.

[0067] In operation S220 , the document to be converted is processed using a preset language model to obtain a plurality of content elements.

[0068] In operation S230 , for each content element, an element tag corresponding to the content element is determined from the general table template, and the content element is filled into a cell corresponding to the element tag based on the element tag to obtain an initial table.

[0069] In operation S240 , text parsing is performed on the initial form to obtain form configuration information.

[0070] In operation S250 , a conversion form file in a preset format is generated according to the form configuration information and the target form template in a preset format.

[0071] According to an embodiment of the present application, the document to be converted can be a regulatory document or a policy document, or any other type of document. The preset language model can be a Large Language Model (LLM). The format of the general table template can refer to the table format used on computers in daily life. The element label can refer to the content filled in the cell, such as the title, element name, specific element value, etc. The preset format of the target table template can be specifically set according to actual needs, for example, it can be HTML format.

[0072] According to an embodiment of the present application, for a certain type of document to be converted, a general form template corresponding to the document to be converted is first obtained, and then the document to be converted is input into a preset language model to extract content elements in the document to be converted.

[0073] In a specific embodiment, if a sentence in the document to be converted is "When a bank opens an account for a customer, the most basic requirement is to provide identity proof materials", the content elements output by the preset language model are "basic requirements for opening an account" and "identity proof materials" respectively.

[0074] According to an embodiment of the present application, for each content element, the element tag is first determined from the general form template. For example, the element tag for "Basic Account Opening Requirements" is "Condition Name," and the element tag for "Identity Proof Materials" is "Condition Parameter Value." After determining the element tag for each content element, the cell corresponding to the value of the content element is filled in, thereby obtaining an initial form after preliminary conversion.

[0075] According to an embodiment of the present application, since the current initial form is of a type that is easy for manual reading, it needs to be converted into information that can be parsed by the program, thereby performing text parsing on the initial form to obtain form configuration information, which includes the content of each cell and the text attribute parameters of the text in the cell, such as font size, font bold mark, font color, font type, etc.

[0076] According to an embodiment of the present application, the content of the form configuration information obtained by parsing is filled into a target form template in a preset format, thereby obtaining a conversion form file in the preset format.

[0077] According to an embodiment of the present application, a document to be converted is processed using a preset language model to obtain multiple content elements. For each content element, an element tag corresponding to the content element is determined from a universal table template, and based on the element tag, the content element is filled into the cell corresponding to the element tag to obtain an initial table. The initial table is subjected to text parsing to obtain form configuration information; based on the form configuration information and a target table template in a preset format, a conversion table file in a preset format is generated. Since different types of universal table templates are used to convert the corresponding document to be converted into the initial table, and the conversion table file is converted into a unified format based on the initial table, unified and standardized processing of different types of documents to be converted is achieved, reducing the difficulty of interpreting the document to be converted and the cost of manual interpretation, thereby improving the efficiency of interpreting the document to be converted.

[0078] According to an embodiment of the present application, obtaining a document to be converted and a general form template corresponding to the document to be converted includes: determining the document type according to the document to be converted; and obtaining a general form template corresponding to the document type from a template library based on the document type.

[0079] According to the embodiments of the present application, different types of documents to be converted may have different contents. For example, policy documents may contain a large number of requirements or guidelines for banks and other financial institutions, while internal financial analysis reports may contain cost, income, and expenditure data for different years and projects. Therefore, different types of conversion documents should be processed using different general form templates.

[0080] According to an embodiment of the present application, for any type of document to be converted, the document type can be determined from the file name of the document to be converted, or from the summary content of the document to be converted. After the document type is determined, a general form template corresponding to the document type is searched from the template library, and the general form template is used to process the document to be converted.

[0081] According to an embodiment of the present application, the general form template of the document type to be converted is determined by the document type of the document to be converted, thereby unifying and standardizing the processing of different documents to be converted of the same document type, thereby improving the conversion efficiency of the documents to be converted.

[0082] Figure 3 The flowchart of the method for extracting content elements according to an embodiment of the present application is schematically shown.

[0083] like Figure 3 As shown, the document to be converted is processed using a preset language model to obtain multiple content elements, including operations S310 to S330:

[0084] In operation S310 , a plurality of document examples related to the document type are extracted from a document knowledge base based on the document type of the document to be converted.

[0085] In operation S320 , target prompt words are generated according to the plurality of document samples, the document to be converted, and the basic prompt words, wherein the target prompt words include event prompt words of the document type and attribute prompt words corresponding to the event prompt words.

[0086] In operation S330, information is extracted from the event prompt words and the attribute prompt words using a preset language model to obtain a plurality of content elements, wherein the content elements include element names corresponding to the event prompt words and element attributes corresponding to the attribute prompt words.

[0087] According to an embodiment of the present application, the number of document samples can be specifically set according to actual needs, for example, 9. The document knowledge base can be stored in a database, and the document knowledge base in the database stores multiple document samples corresponding to different document types. When obtaining document samples, a preset number of samples can be randomly selected from the multiple document samples of the document type as document samples. The element name can refer to specific content information, and the element attribute can refer to attribute parameters of the content information, such as font size, font, and bold.

[0088] According to an embodiment of the present application, the document sample may include a document to be converted of the document type in a historical period and content elements extracted from the document to be converted.

[0089] According to an embodiment of the present application, multiple document samples and documents to be converted are added to the basic prompt words to obtain target prompt words. The target prompt words include event prompt words of the document type and attribute prompt words corresponding to the event prompt words. The event prompt words are input into a preset language model so that the preset language model extracts information from the event prompt words based on the event prompt words, thereby obtaining content elements corresponding to the event prompt words. Similarly, the attribute prompt words are input into the preset language model for extraction to obtain content elements corresponding to the attribute prompt words.

[0090] According to an embodiment of the present application, during the information extraction process for a document to be converted, multiple document samples from historical periods and the document to be converted are combined with basic prompt words to obtain target prompt words, including event prompt words and attribute prompt words. A preset language model is then used to extract information from the event prompt words and attribute prompt words to obtain the content elements of the target prompt words. Because the target prompt words are generated based on multiple document samples, the document to be converted, and the basic prompt words, the accuracy of information extraction from the document to be converted is effectively improved.

[0091] According to an embodiment of the present application, target prompt words are generated based on multiple document samples, documents to be converted and basic prompt words, including: sorting the multiple document samples based on preset sorting rules to obtain multiple sorted document samples; generating target prompt words based on the multiple sorted document samples, documents to be converted and basic prompt words.

[0092] According to an embodiment of the present application, a plurality of document samples are first sorted based on preset sorting rules to obtain a plurality of sorted document samples, wherein the preset sample sorting rules may include rules such as sorting based on the occurrence time of the document sample or the similarity between the document sample and the document to be converted.

[0093] According to an embodiment of the present application, the sorted plurality of document samples and the document to be converted are added to the basic prompt word, thereby obtaining the target prompt word.

[0094] According to an embodiment of the present application, after sorting multiple document samples of this document type in the historical period, the target prompt words are obtained by combining the document to be converted and the basic prompt words. The preset language model can effectively improve the accuracy of information extraction of the document to be converted when extracting information based on the target prompt words.

[0095] Figure 4 The flowchart of the method for sorting document samples according to an embodiment of the present application is schematically shown.

[0096] like Figure 4 As shown, based on a preset sorting rule, a plurality of document samples are sorted to obtain a plurality of sorted document samples, including operations S410 to S430.

[0097] In operation S410 , vector conversion is performed on each document sample and the document to be converted, respectively, to obtain a plurality of sample vectors and document vectors.

[0098] In operation S420 , for each document example, vector similarity between the example vector and the document vector is calculated.

[0099] In operation S430 , the plurality of document examples are sorted based on the vector similarity of each document example to obtain a plurality of sorted document examples.

[0100] According to an embodiment of the present application, the document sample and the document to be converted are first converted into vector form to obtain a sample vector and a document vector, wherein the vector conversion method can be converted into a vector form through a bag-of-words model, a sentence embedding model, etc.

[0101] According to an embodiment of the present application, for each document sample, the vector similarity between the sample vector and the document vector is calculated. The vector similarity can be calculated using the calculation formulas of Euclidean distance, Manhattan distance, and cosine similarity.

[0102] According to an embodiment of the present application, multiple document samples are sorted according to the size of vector similarity. For example, multiple document samples can be sorted in order from low to high vector similarity, and then the sorted multiple document samples are combined with basic prompt words to obtain target prompt words.

[0103] According to an embodiment of the present application, to further improve the accuracy of information extraction from documents to be converted, a similarity threshold can be set. The threshold can be set based on actual needs, for example, 60 points (the matching score range is 0-100 points). If a document sample has a matching score less than 60 points, it can be discarded and the remaining document samples can be sorted. Alternatively, if several are discarded, several more can be retrieved, thereby ensuring that the number of sorted document samples always remains at the preset number.

[0104] According to an embodiment of the present application, since the preset language model is more sensitive to the beginning and ending content of the target prompt word, sorting multiple document samples from small to large further improves the accuracy of information extraction of the document to be converted.

[0105] According to an embodiment of the present application, the initial table is subjected to text parsing processing to obtain form configuration information, including: for each row of cells in the initial table, using separators to splice the content elements in multiple cells in the row to obtain one configuration information; generating form configuration information based on multiple configuration information.

[0106] According to an embodiment of the present application, for the parsing process of the initial table, the content elements in multiple cells in the row are first read row by row, and different content elements can be spliced ​​using any type of separator to obtain the configuration information of the row, which includes the element name and element attributes.

[0107] In a specific embodiment, the configuration information obtained by splicing according to rows can be "XXX∞tr∞3∞font-weight:bold∞font-family:"Font type A"∞font-size:3rem∞font-color:black", where ∞ is a separator, XXX is the element name, tr∞3 is the third row, font-weight:bold is the text bold mark, font-family:"Font type A" indicates that the font type of the element name is A, font-size:3rem indicates that the font size of the element name is size 3, and font-color:black indicates that the font color of the element name is black.

[0108] In another embodiment, multiple cells in the column can be spliced ​​in the form of columns, and the configuration information obtained by splicing can be expressed as "YYY∞td∞1∞font-family:"Font type B"∞font-size:5rem∞font-color:red∞HHH∞td∞2", where ∞ is a separator, YYY is the element name, td∞1 is the first column, font-family:"Font type B" indicates that the font type of the element name is B, font-size:5rem indicates that the font size of the element name is size 5, font-color: red indicates that the font color of the element name is red, and HHH∞td∞2 indicates that the element name in the second column is HHH.

[0109] According to an embodiment of the present application, the configuration information of different rows or columns is output to a configuration file, thereby obtaining form configuration information that can be parsed by the program.

[0110] According to an embodiment of the present application, a conversion table file in a preset format is generated based on the form configuration information and the target table template in a preset format, including: extracting each configuration information from the form configuration information; for each configuration information, splitting the configuration information based on a delimiter to obtain multiple unit elements; filling the unit elements into the cells corresponding to the type of the unit elements in the target table template according to the type of the unit elements, to generate a conversion table file.

[0111] According to an embodiment of the present application, the form configuration information in the configuration file is first loaded, and then each configuration information is read in sequence according to the number of configuration information items. For the configuration information, the configuration information is split based on the separator in the configuration information, thereby obtaining multiple unit elements in the row or column, and the unit element includes the corresponding element name and element attributes recorded previously.

[0112] According to an embodiment of the present application, a plurality of unit elements are sequentially filled into a target table template according to the type of each unit element, and the filled target table template is coded and output to obtain a conversion table file.

[0113] According to an embodiment of the present application, the use of a target form template can convert different documents to be converted under the same document type into standardized forms in a unified format, thereby improving the efficiency of interpreting the documents to be converted.

[0114] Based on the above document format conversion method, the present application also provides a document format conversion device. Figure 5 The device is described in detail.

[0115] Figure 5 The structural block diagram of the document format conversion device according to an embodiment of the present application is schematically shown.

[0116] like Figure 5 As shown, the document format conversion device 500 of this embodiment includes an acquisition module 510 , an extraction module 520 , a filling module 530 , a parsing module 540 , and a generation module 550 .

[0117] The acquisition module 510 is used to acquire a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template includes a plurality of cells and an element label corresponding to each cell.

[0118] The extraction module 520 is used to process the document to be converted using a preset language model to obtain multiple content elements.

[0119] The filling module 530 is used to determine the element tag corresponding to each content element from the general table template, and fill the content element into the cell corresponding to the element tag based on the element tag to obtain an initial table.

[0120] The parsing module 540 is used to perform text parsing on the initial form to obtain form configuration information.

[0121] The generating module 550 is used to generate a conversion table file in a preset format according to the form configuration information and the target table template in a preset format.

[0122] According to an embodiment of the present application, a document to be converted is processed using a preset language model to obtain multiple content elements. For each content element, an element tag corresponding to the content element is determined from a universal table template, and based on the element tag, the content element is filled into the cell corresponding to the element tag to obtain an initial table. The initial table is subjected to text parsing to obtain form configuration information; based on the form configuration information and a target table template in a preset format, a conversion table file in a preset format is generated. Since different types of universal table templates are used to convert the corresponding document to be converted into the initial table, and the conversion table file is converted into a unified format based on the initial table, unified and standardized processing of different types of documents to be converted is achieved, reducing the difficulty of interpreting the document to be converted and the cost of manual interpretation, thereby improving the efficiency of interpreting the document to be converted.

[0123] According to an embodiment of the present application, the acquisition module 510 includes a determination unit and an acquisition unit.

[0124] The determining unit is used to determine the document type according to the document to be converted.

[0125] The acquisition unit is used to acquire a general form template corresponding to the document type from a template library based on the document type.

[0126] According to an embodiment of the present application, the extraction module 520 includes an extraction submodule, a generation submodule, and an acquisition submodule.

[0127] The extraction submodule is used to extract multiple document samples related to the document type from the document knowledge base based on the document type of the document to be converted.

[0128] The generation submodule is used to generate target prompt words according to multiple document samples, documents to be converted and basic prompt words, wherein the target prompt words include event prompt words of the document type and attribute prompt words corresponding to the event prompt words.

[0129] The obtaining submodule is used to extract information from event prompt words and attribute prompt words using a preset language model to obtain multiple content elements, wherein the content elements include element names corresponding to event prompt words and element attributes corresponding to attribute prompt words.

[0130] According to an embodiment of the present application, the generation submodule includes a sorting unit and a first generation unit.

[0131] The sorting unit is used to sort the multiple document samples based on a preset sorting rule to obtain a plurality of sorted document samples.

[0132] The first generating unit is configured to generate a target prompt word according to the sorted plurality of document examples, the document to be converted, and the basic prompt word.

[0133] According to an embodiment of the present application, the sorting unit includes a conversion subunit, a calculation subunit, and a sorting subunit.

[0134] The conversion subunit is used to perform vector conversion on each document sample and the document to be converted respectively, to obtain multiple sample vectors and document vectors.

[0135] The calculation subunit is used to calculate the vector similarity between the sample vector and the document vector for each document sample.

[0136] The sorting subunit is used to sort multiple document samples based on the vector similarity of each document sample to obtain multiple sorted document samples.

[0137] According to an embodiment of the present application, the parsing module 540 includes a splicing unit and a second generating unit.

[0138] The splicing unit is used to splice content elements in multiple cells in each row of the initial table using a separator to obtain a piece of configuration information.

[0139] The second generating unit is used to generate form configuration information according to the multiple pieces of configuration information.

[0140] According to an embodiment of the present application, the generation module 550 includes an extraction unit, a splitting unit, and a generation unit.

[0141] The extraction unit is used to extract each configuration information from the form configuration information.

[0142] The split unit is used to split each piece of configuration information based on a separator to obtain multiple unit elements.

[0143] The generation unit is used to fill the unit elements into the cells corresponding to the type of the unit elements in the target table template according to the type of the unit elements, and generate a conversion table file.

[0144] According to embodiments of the present application, any multiple modules among the acquisition module 510, extraction module 520, filling module 530, parsing module 540, and generation module 550 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present application, at least one of the acquisition module 510, extraction module 520, filling module 530, parsing module 540, and generation module 550 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of these. Alternatively, at least one of the acquisition module 510 , the extraction module 520 , the filling module 530 , the parsing module 540 , and the generation module 550 may be at least partially implemented as a computer program module, which may perform corresponding functions when executed.

[0145] Figure 6 A block diagram of an electronic device suitable for implementing the above method according to an embodiment of the present application is schematically shown.

[0146] like Figure 6 As shown, an electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes based on a program stored in a read-only memory (ROM) 602 or a program loaded from a storage unit 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0147] Various programs and data required for the operation of the electronic device 600 are stored in the RAM 603. The processor 601, ROM 602, and RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flow according to the embodiment of the present application by executing the programs in the ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flow according to the embodiment of the present application by executing the programs stored in the one or more memories.

[0148] According to an embodiment of the present application, electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to bus 604. Electronic device 600 may also include one or more of the following components connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 608 including a hard disk; and a communication section 609 including a network interface card such as a LAN card or modem. Communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. Removable media 611, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 610 as needed, so that computer programs read from the removable media can be installed into storage section 608 as needed.

[0149] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the method according to the embodiments of this application is implemented.

[0150] According to an embodiment of the present application, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include the ROM 602 and / or RAM 603 described above and / or one or more memories other than ROM 602 and RAM 603.

[0151] The embodiments of the present application also include a computer program product, which includes a computer program containing program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided in the embodiments of the present application.

[0152] The computer program executes the above functions defined in the system / device of the embodiment of the present application when the computer program is executed by the processor 601. According to the embodiment of the present application, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0153] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0154] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from a removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present application are performed. According to the embodiment of the present application, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.

[0155] According to an embodiment of the present application, the program code for executing the computer program provided by the embodiment of the present application can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).

[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] Those skilled in the art will appreciate that the features described in the various embodiments of this application may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in this application. In particular, the features described in the various embodiments of this application may be combined and / or coupled in various ways without departing from the spirit and teachings of this application. All such combinations and / or couplings fall within the scope of this application.

[0158] The embodiments of the present application have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present application. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. The present application does not depart from the scope of the present application, and those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present application.

Claims

1. A document format conversion method, characterized in that: The method comprises: Acquire a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template includes a plurality of cells and an element label corresponding to each cell; Processing the document to be converted using a preset language model to obtain a plurality of content elements; For each of the content elements, determining an element tag corresponding to the content element from the general table template, and filling the content element into a cell corresponding to the element tag based on the element tag to obtain an initial table; Performing text parsing on the initial form to obtain form configuration information; A conversion table file in the preset format is generated according to the form configuration information and a target table template in the preset format.

2. The method according to claim 1, characterized in that Obtaining a document to be converted and a general form template corresponding to the document to be converted, including: Determining a document type according to the document to be converted; A general form template corresponding to the document type is acquired from a template library based on the document type.

3. The method according to claim 1, characterized in that The document to be converted is processed using a preset language model to obtain multiple content elements, including: Extracting a plurality of document samples related to the document type from a document knowledge base based on the document type of the document to be converted; generating target prompt words according to the plurality of document samples, the document to be converted and basic prompt words, wherein the target prompt words include event prompt words of the document type and attribute prompt words corresponding to the event prompt words; The preset language model is used to extract information from the event prompt word and the attribute prompt word to obtain a plurality of content elements, wherein the content elements include element names corresponding to the event prompt word and element attributes corresponding to the attribute prompt word.

4. The method according to claim 3, characterized in that Generating target prompt words according to the plurality of document samples, the document to be converted, and the basic prompt words, including: Sorting the plurality of document samples based on a preset sorting rule to obtain a plurality of sorted document samples; The target prompt word is generated according to the sorted multiple document samples, the document to be converted and the basic prompt word.

5. The method according to claim 4, characterized in that Sorting the plurality of document samples based on a preset sorting rule to obtain a plurality of sorted document samples, including: Performing vector conversion on each of the document samples and the document to be converted respectively to obtain multiple sample vectors and document vectors; For each of the document samples, calculating the vector similarity between the sample vector and the document vector; Based on the vector similarity of each of the document samples, the plurality of document samples are sorted to obtain a plurality of sorted document samples.

6. The method according to claim 1, characterized in that Perform text parsing on the initial form to obtain form configuration information, including: For cells in each row of the initial table, concatenate content elements in multiple cells in the row using a separator to obtain a piece of configuration information; The form configuration information is generated according to the plurality of pieces of configuration information.

7. The method according to claim 1 or 6, characterized in that Generating a conversion table file in the preset format according to the form configuration information and a target table template in the preset format, including: Extract each configuration information from the form configuration information; For each piece of configuration information, split the configuration information based on a separator to obtain a plurality of unit elements; The unit element is filled into a cell corresponding to the type of the unit element in the target table template according to the type of the unit element, so as to generate the conversion table file.

8. A document format conversion device, characterized in that: The device comprises: An acquisition module, configured to acquire a document to be converted and a general table template corresponding to the document to be converted, wherein the general table template includes a plurality of cells and an element label corresponding to each cell; An extraction module, configured to process the document to be converted using a preset language model to obtain a plurality of content elements; a filling module, configured to determine, for each of the content elements, an element tag corresponding to the content element from the general table template, and fill the content element into a cell corresponding to the element tag based on the element tag to obtain an initial table; A parsing module, configured to perform text parsing on the initial form to obtain form configuration information; The generating module is used to generate a conversion table file in the preset format according to the form configuration information and the target table template in the preset format.

9. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Generation method and generation device of batch record table and storage medium

    CN120930617A