Document processing methods and apparatus, non-volatile storage media, electronic devices

By classifying and merging the border data of form text information, a neural network model was used to automatically extract form text information, solving the problem that traditional systems have difficulty adapting to the flexible format of two-dimensional forms, and improving recognition accuracy and coverage.

CN115188005BActive Publication Date: 2026-05-26ALIBABA INNOVATION PRIVATE LIMITED

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA INNOVATION PRIVATE LIMITED
Filing Date
2021-04-01
Publication Date
2026-05-26

Smart Images

  • Figure CN115188005B_ABST
    Figure CN115188005B_ABST
Patent Text Reader

Abstract

This application discloses a file processing method and apparatus, a non-volatile storage medium, and an electronic device. The method includes: acquiring a file to be parsed; parsing the file to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; classifying the border data to obtain a classification result; determining the category information of the border data based on the classification result; and merging the category information and text content of the border data to obtain a target result. This application solves the technical problems of existing rule-based automatic identification and extraction systems, which often rely on a large number of manually pre-set rules, making it difficult to adapt to the flexible format of two-dimensional forms, and resulting in low accuracy and coverage of extracted identification information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of document processing, and more specifically, to a document processing method and apparatus, a non-volatile storage medium, and an electronic device. Background Technology

[0002] In the customs declaration process for imports and exports, customs declarants are often required to provide various customs documents to describe information about the declarant and the goods being declared. Most customs declarants are not fully familiar with the content and format of the customs-required documents, resulting in inconsistent formats of the original documents. Documents submitted from different sources also vary in format, requiring significant manual effort to compile and extract them into a standard format. Therefore, to reduce the manual cost of compiling and extracting standard formats, a rule-based automatic identification and extraction system is used to automatically identify and extract the necessary fields from customs documents.

[0003] However, traditional rule-based automatic identification and extraction systems often rely on a large number of rules that are pre-set manually. That is, the formulation of the rules themselves still requires a lot of human intervention, and the rules are not easy to update, making it difficult to adapt to the flexible format of two-dimensional forms. The extraction accuracy and coverage are low, and they cannot handle documents with text recognition and input errors well.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This application provides a document processing method and apparatus, a non-volatile storage medium, and an electronic device to at least solve the technical problems of traditional rule-based automatic identification and extraction systems in the prior art, which often rely on a large number of rules pre-set by humans, making it difficult to adapt to the flexible format of two-dimensional forms, and resulting in low accuracy and coverage of extracted and identified information.

[0006] According to one aspect of the embodiments of this application, a file processing method is provided, comprising: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain a target result.

[0007] According to another aspect of the embodiments of this application, a file processing method is also provided, comprising: training a neural network model using multiple sets of training data through machine learning, wherein each set of training data includes: text content of border data to be trained and text content of adjacent border data of the border data to be trained, and the text content of the border data to be trained is labeled and classified; parsing form text information from a file to be parsed, wherein the form text information includes: text content and position information of some or all border data contained in the form; obtaining border data to be identified and adjacent border data of the border data to be identified from the partial or all border data based on the position information; setting the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model, and using the neural network model to classify the text content of the border data to be identified to obtain a classification result; determining the category information of each border data in the partial or all border data based on the classification result; and merging the category information and text content of each border data in the partial or all border data to obtain a target result.

[0008] According to another aspect of the embodiments of this application, a file processing method is also provided, comprising: parsing form text information from a file to be parsed, wherein the form text information includes: text content and position information of some or all border data contained in the form; obtaining border data to be identified and adjacent border data of the border data to be identified from the border data to be parsed based on the position information; setting the text content of the border data to be identified and the text content of the adjacent border data as input parameters of a neural network model, and using the neural network model to classify the text content of the border data to be identified to obtain a classification result, wherein the neural network model is a prediction model obtained by machine learning training from multiple sets of training data, each set of training data including: text content of border data to be trained and text content of multiple border data adjacent to the border data to be trained, and the labeled classification of the text content of the border data to be trained; determining the category information of each border data in the border data to be parsed based on the classification result; and merging the category information and text content of each border data to be parsed to obtain a target result.

[0009] According to another aspect of the embodiments of this application, a file processing apparatus is also provided, comprising: an acquisition module for acquiring a file to be parsed; a parsing module for parsing the file to be parsed to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; a classification module for classifying the some or all border data to obtain a classification result; a determination module for determining the category information of the some or all border data based on the classification result; and a merging module for merging the category information and text content of the some or all border data to obtain a target result.

[0010] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored program, wherein, when the program is running, it controls the device where the non-volatile storage medium is located to execute any of the above-described file processing methods.

[0011] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; and a memory connected to the processor, configured to provide the processor with instructions to perform the following processing steps: acquiring a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain a target result.

[0012] In this embodiment of the application, the following steps are performed: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain the target result.

[0013] It is noteworthy that, in this embodiment of the application, the task of extracting form text information is transformed into the task of classifying some or all border data contained in the form text information. The task of classifying some or all border data of the form text information is directly performed, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0014] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information. Attached Figure Description

[0015] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0016] Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a file processing method according to an embodiment of this application;

[0017] Figure 2 This is a flowchart of a document processing method according to an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of an optional image type of file to be parsed according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram illustrating an optional method of parsing to obtain partial or complete border data according to an embodiment of this application;

[0020] Figure 5 This is a flowchart of another document processing method according to an embodiment of this application;

[0021] Figure 6 This is a flowchart of another document processing method according to an embodiment of this application;

[0022] Figure 7 This is a schematic diagram of the structure of a document processing apparatus according to an embodiment of this application;

[0023] Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;

[0024] Figure 9 This is a structural block diagram of another computer terminal according to an embodiment of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0027] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0028] Knowledge base: A database, an abstraction of human knowledge, usually containing entities and the relationships between entities.

[0029] Information extraction: refers to a task of extracting specific messages from text data.

[0030] Example 1

[0031] According to an embodiment of this application, a document processing method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0032] The method embodiment provided in Embodiment 1 of this application can be executed in a mobile terminal, computer terminal or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a file processing method is shown, such as... Figure 1As shown, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0033] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0034] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the file processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned file processing method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0035] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0036] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0037] Under the aforementioned operating environment, this application provides the following: Figure 2 The document processing method embodiment shown is as follows: Figure 2 This is a flowchart of a document processing method according to an embodiment of this application, such as... Figure 2 As shown, the file processing method includes:

[0038] Step S202: Obtain the file to be parsed;

[0039] Step S204: The above-mentioned file to be parsed is parsed to obtain form text information, wherein the above-mentioned form text information includes: the text content and position information of some or all of the border data contained in the form;

[0040] Step S206: Classify some or all of the above border data to obtain classification results;

[0041] Step S208: Determine the category information of some or all of the above border data based on the above classification results;

[0042] Step S210: Merge the category information and text content of some or all of the above border data to obtain the target result.

[0043] In this embodiment of the application, the following steps are performed: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain the target result.

[0044] It is noteworthy that, in this embodiment of the application, the task of extracting form text information is transformed into the task of classifying some or all border data contained in the form text information. The task of classifying some or all border data of the form text information is directly performed, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0045] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information.

[0046] It should be noted that the document processing methods provided in this application can be applied, but are not limited to, in customs scenarios, financial scenarios, smart retail scenarios, online shopping scenarios, and community shopping scenarios. For example, they can be applied, but are not limited to, in import and export declaration application scenarios in customs scenarios to automatically extract and process the form text information contained in import and export declaration documents; for example, they can be applied, but are not limited to, in form aggregation, form verification, and account detail management application scenarios in financial scenarios to process the form text information contained in various financial documents in financial scenarios; and for example, they can also be applied, but are not limited to, in income and expenditure form aggregation, product form verification, and account detail management application scenarios in smart retail scenarios to process the form text information contained in various account documents in smart retail scenarios.

[0047] In an optional embodiment, for example, taking the application scenario of a document processing method provided in the embodiments of this application applied to customs declaration as an example, the above embodiments of this application will be described in detail. For example, by implementing or running the above document processing method provided in the embodiments of this application in a customs declaration document parsing and extraction system (or other similar processing system or device), it is possible to parse customs declaration documents to obtain two-dimensional form text information. Then, by transforming the extraction task of two-dimensional form information into a classification task of each border data, the content of each cell of the input document can be directly classified and labeled, which can greatly improve the recognition accuracy, and has stronger robustness and higher business value.

[0048] In addition, based on the differences in application scenarios and application personalization, this application can also provide an optional embodiment of the document processing method applied to financial scenarios and smart retail scenarios, and will provide a detailed description of the above embodiments of this application. For example, in the accounting settlement process in a financial scenario, the clearing unit or individual provides various clearing documents to describe the accounting information of the settlement. Due to inconsistencies in the habits or requirements of clearing units or individuals, the clearing documents provided by different clearing units or individuals are not entirely the same, for example, they may be clearing documents in different formats and types, such as image format, PDF format, Word format, Excel format, etc. Again, for example, in the accounting settlement process in a financial scenario, the clearing unit or individual provides various clearing documents to describe the accounting information of the settlement. Due to inconsistencies in the habits or requirements of clearing units or individuals, the clearing documents provided by different clearing units or individuals are not entirely the same, for example, they may be clearing documents in different formats and types, such as image format, PDF format, Word format, Excel format, etc.

[0049] Therefore, the file processing solution provided in the embodiments of this application can be adopted in the above-mentioned different application scenarios. By implementing or running the above-mentioned file processing method in the processing equipment or processing system of different business scenarios, it is possible to parse the file to be parsed in financial scenarios and smart retail scenarios to obtain two-dimensional form text information. Then, by transforming the task of extracting two-dimensional form information into the task of classifying each border data, the content of each cell of the input document can be directly classified and labeled, which can greatly improve the recognition accuracy, and has stronger robustness and higher financial business value.

[0050] Optionally, the file to be parsed can be a document file, such as a customs declaration, a financial statement, a sales order, etc.; the form text information can be two-dimensional form text information; the partial or complete border data refers to the bounding box data of some or all cells in a two-dimensional form, rather than cell data in the strict sense of a table.

[0051] In one optional embodiment, the file to be parsed can be parsed based on a border data discrimination model to obtain form text information. The main process of the parsing can be, but is not limited to, using a file parsing tool or file parsing module to parse different file types of files to extract two-dimensional form text information from the files to be parsed. The file types of the files to be parsed can include any of the following: images, PDFs, Word documents, Excel files, etc.

[0052] For example, taking the document processing method provided in the embodiments of this application as an example applied to a customs declaration scenario, the above embodiments of this application will be described in detail. In the import and export customs declaration process, the customs declaring unit provides various customs declaration documents to describe various information about the customs declaring unit and the declared goods. For example, it may receive image-type customs declaration documents from the customs declaring unit, or it may also receive customs declaration documents in PDF, Word, Excel, or other formats. The embodiments of this application, through the application of such... Figure 3 The image-type file to be parsed is shown below. This allows us to obtain some or all of the border data contained in the two-dimensional form within the file (i.e., as shown below). Figure 4 The text content and position information of the border data (i.e., bounding box data, not strictly speaking cell data in the table) are as follows:

[0053] […,

[0054] text=number of pieces pos=(100,100,110,130),

[0055] text = gross weight (kg) pos = (100, 250, 110, 300),

[0056] text = net weight (kg) pos = (100, 320, 110, 370),

[0057] text=1000pos=(120,100,130,135),

[0058] text=24000pos=(120,240,130,285),

[0059] text=22000pos=(120,320,130,355),

[0060] …]

[0061] Wherein, "text" refers to the text content of the border data, and "pos" refers to the four corner coordinates of the border data: the top left vertical axis coordinate, the top left horizontal axis coordinate, the bottom right vertical axis coordinate, and the bottom right horizontal axis coordinate.

[0062] In one optional embodiment, the classification process is performed on some or all of the above-mentioned border data to obtain the above-mentioned classification results, including:

[0063] Step S302: Based on the above location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the above partial or all border data.

[0064] Step S302: Set the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model, and use the neural network model to classify the text content of the border data to be identified to obtain the classification result.

[0065] The aforementioned neural network model is a prediction model obtained by machine learning training from multiple sets of training data. Each set of training data includes: the text content of the bounding box data to be trained and the text content of the adjacent bounding box data of the bounding box data to be trained, as well as the annotation and classification of the text content of the bounding box data to be trained.

[0066] As an optional embodiment, in this application, the information categories to be extracted are constructed in advance using domain knowledge. During training, customs declaration documents can be manually annotated to obtain labeled data (location information and its corresponding category information), and the classification model is trained through the labeled data. In the specific text processing process, the trained classification model is used to classify the parsed customs declaration documents one by one according to the border data, and the information extraction results are obtained after a series of subsequent processing and organization.

[0067] For example, a neural network model (i.e., an extraction model or extraction tool, such as a CNN convolutional neural network model) is used to classify some or all of the border data in the parsed two-dimensional form one by one. During classification, the text content of the currently identified border data and the text content of its adjacent (i.e., surrounding) border data are used as input parameters of the neural network model to predict the category information to which the text content of the current border data belongs.

[0068] As an optional embodiment, the document processing method provided in this application, applied to a customs declaration scenario, will be used as an example to illustrate the above-mentioned embodiments of this application in detail. For example, in the case of... Figure 4 The border data shown: Gross weight text = 24000 pos = (120, 240, 130, 285) can be used for classification processing. The text content of this border data (i.e., such as...) Figure 4 The specific gross weight value shown is 24000) and the text content of its adjacent frame border data (i.e., such as Figure 4 The number of items, gross weight (kg), net weight (kg), and specific net weight value (22000) shown are used together as input parameters of the neural network model. The neural network model is used to classify the text content of the border data to be identified and predict the category information of the border data as gross weight.

[0069] In one optional embodiment, the above-described neural network model is used to classify the text content of the border data to be identified, and the classification results include:

[0070] Step S402: Use the above neural network model to convert the text content of the border data to be identified and the text content of the adjacent border data into multiple vector representations;

[0071] Step S404: Concatenate the above multiple vector representations to obtain the vector representation to be identified;

[0072] Step S406: Determine the classification result based on the above-mentioned vector representation to be identified.

[0073] In this embodiment, the text content of the border data and the text content of its adjacent border data (i.e., top left, top, top right, right, bottom right, bottom, bottom left, left) are used together as input parameters of the neural network model. If no adjacent border data is found or the text content of the adjacent border is empty, a special field [EMPTY] is used to represent it.

[0074] In an optional embodiment, using the aforementioned neural network model to convert the text content of the border data to be identified and the text content of the adjacent border data into the aforementioned multiple vector representations includes:

[0075] Step S502: The text content of the border data to be identified and the text content of the adjacent border data are processed into character vectors by the neural network model to obtain the first processing result.

[0076] Step S504: Input the first processing result into the convolutional neural network model and output the second processing result;

[0077] Step S506: Perform max pooling on the second processing result to obtain the multiple vector representations.

[0078] In an optional embodiment, determining the classification result based on the above-described vector representation to be identified includes:

[0079] Step S602: Pass the above multiple vector representations through the feedforward network model and the classification task output layer to obtain the classification result.

[0080] As an optional embodiment, the text content of each bounding box data to be identified is processed by character vectorization to obtain a first processing result. The first processing result is then input into a CNN convolutional neural network model to obtain a second processing result. The second processing result is then subjected to max pooling to obtain multiple vector representations of the text content of the bounding box data to be identified. The multiple vector representations are concatenated and processed by a feedforward network model (i.e., a feedforward neural network model) and the output layer of the classification task to obtain a classification result.

[0081] In this embodiment of the application, a merging processing module or merging processing tool is used to merge the category information and text content of some or all of the above-mentioned border data to obtain the target result.

[0082] For example, by using a merging processing module or tool, the categories and contents of the various border data to be identified extracted in the above customs declaration application scenario embodiment can be extracted and merged, and converted into Key-Value output results. For example, the Key-Value output result of the border data in the above customs declaration application scenario embodiment is: [(Trading Country: USA), (Number of Items: 1000), (Gross Weight: 24000), (Net Weight: 22000)]. This application embodiment can effectively utilize the rich two-dimensional contextual information of two-dimensional forms, adapt to various formats of customs declaration documents, and greatly improve the efficiency of text information extraction and recognition.

[0083] In an optional embodiment, the above method further includes:

[0084] Step S702: Set the text content of the bounding box data to be trained and the text content of the adjacent bounding box data of the bounding box data to be trained as the input parameters of the neural network model, and use the neural network model to classify the text content of the bounding box data to be identified to obtain the classification probability of the text content of the bounding box data to be trained.

[0085] Step S704: Compare the above classification probabilities with the above labeled classifications, and determine the error using a loss function;

[0086] Step S706: Update the network parameters of the neural network model based on the aforementioned error.

[0087] As an optional embodiment, it is also possible, but not limited to, obtaining a first processing result by vectorizing the text content of each bounding box data to be identified, and then obtaining a second processing result by inputting the first processing result into a CNN convolutional neural network model; and performing max pooling on the second processing result to obtain multiple vector representations of the text content of the bounding box data to be identified, concatenating the multiple vector representations, and processing them through a feedforward network model (i.e., a feedforward neural network model) and a classification task output layer to obtain a classification result, such as a classification probability.

[0088] In this embodiment, the classification probability can be compared with the manually labeled result, the error can be further calculated through the loss function, the network parameters of the CNN convolutional neural network model can be updated through the backpropagation algorithm, and the model can be iteratively learned.

[0089] In one optional embodiment of this application, the document processing method provided in the embodiments of this application is still taken as an example of its application in a customs declaration scenario, and the above embodiments of this application will be described in detail. By classifying the border data of each customs declaration document one by one, the category information of each border data is obtained, for example, predicting... Figure 3 The category information of the customs declaration document obtained from the border data shown can be, but is not limited to, as shown below:

[0090]

[0091] The solution proposed in this application, by making full use of the rich two-dimensional contextual information of two-dimensional form text, has better generalization for form text information of different formats compared with the information extraction model based on border data classification constructed by manually labeled data in the prior art. It also has better processing performance for recognition and extraction while reducing manual input.

[0092] According to an embodiment of this application, another embodiment of a file processing method is provided. Figure 5 This is a flowchart of a document processing method according to an embodiment of this application, such as... Figure 5 As shown, the file processing method includes:

[0093] Step S802: A neural network model is obtained by training multiple sets of training data through machine learning. Each set of training data includes: the text content of the bounding box data to be trained and the text content of the adjacent bounding box data of the bounding box data to be trained, and the annotation and classification of the text content of the bounding box data to be trained.

[0094] Step S804: Parse the form text information from the file to be parsed, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form;

[0095] Step S806: Based on the above location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the above partial or all border data.

[0096] Step S808: Set the text content of the border data to be identified and the text content of the adjacent border data as the input parameters of the neural network model, and use the neural network model to classify the text content of the border data to be identified to obtain the classification result.

[0097] Step S810: Determine the category information of each border data in the above partial or all border data based on the above classification results;

[0098] Step S812: Merge the category information and text content of each border data in the above partial or all border data to obtain the target result.

[0099] In this embodiment, a neural network model is trained using multiple sets of training data through machine learning. This model is then used to parse form text information from a file to be parsed. The form text information includes the text content and position information of some or all border data contained in the form. Based on the position information, the border data to be identified and its adjacent border data are obtained from the partial or complete border data. The text content of the border data to be identified and the text content of its adjacent border data are set as input parameters to the neural network model. The neural network model is then used to classify the text content of the border data to be identified, resulting in a classification result. Based on the classification result, the category information of each border data in the partial or complete border data is determined. Finally, the category information and text content of each border data in the partial or complete border data are merged to obtain the target result.

[0100] It is noteworthy that, in this embodiment of the application, a neural network model is obtained by pre-training multiple sets of training data through machine learning. The task of extracting form text information is transformed into a task of classifying some or all border data contained in the form text information. The neural network model is obtained by pre-training multiple sets of training data through machine learning to classify some or all border data of the form text information, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0101] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information.

[0102] According to an embodiment of this application, another embodiment of a file processing method is provided. Figure 6 This is a flowchart of a document processing method according to an embodiment of this application, such as... Figure 6 As shown, the file processing method includes:

[0103] Step S902: Parse the form text information from the file to be parsed, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form;

[0104] Step S904: Based on the above location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the above partial or all border data.

[0105] Step S906: Set the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model, and use the neural network model to classify the text content of the border data to be identified to obtain a classification result. The neural network model is a prediction model trained by machine learning from multiple sets of training data. Each set of training data includes: the text content of the border data to be trained and the text content of multiple border data adjacent to the border data to be trained, and the labeled classification of the text content of the border data to be trained.

[0106] Step S908: Based on the above classification results, determine the category information of each border data in the above partial or all border data;

[0107] Step S910: Merge the category information and text content of each border data in the above partial or all border data to obtain the target result.

[0108] In this embodiment, form text information is parsed from a file to be parsed. This form text information includes: text content and position information of some or all border data contained in the form; based on the position information, the border data to be identified and its adjacent border data are obtained from the partial or all border data; the text content of the border data to be identified and the text content of its adjacent border data are set as input parameters to the neural network model, and the neural network model is used to classify the text content of the border data to be identified to obtain a classification result; based on the classification result, the category information of each border data in the partial or all border data is determined; the category information and text content of each border data in the partial or all border data are merged to obtain the target result.

[0109] It is noteworthy that, in this embodiment of the application, a neural network model is obtained by pre-training multiple sets of training data through machine learning. The task of extracting form text information is transformed into a task of classifying some or all border data contained in the form text information. The neural network model is obtained by pre-training multiple sets of training data through machine learning to classify some or all border data of the form text information, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0110] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information.

[0111] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0113] Example 2

[0114] According to an embodiment of this application, an apparatus embodiment for implementing the above-described document processing method is also provided. Figure 7 This is a schematic diagram of the structure of a document processing apparatus according to an embodiment of this application, such as... Figure 7As shown, the device includes: an acquisition module 700, a parsing module 702, a classification module 704, a determination module 706, and a merging module 708, wherein:

[0115] The acquisition module 700 is used to acquire the file to be parsed; the parsing module 702 is used to parse the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; the classification module 704 is used to classify the above-mentioned partial or all border data to obtain classification results; the determination module 706 is used to determine the category information of the above-mentioned partial or all border data based on the above classification results; and the merging module 708 is used to merge the category information and text content of the above-mentioned partial or all border data to obtain the target result.

[0116] It should be noted that the acquisition module 700, parsing module 702, classification module 704, determination module 706, and merging module 708 mentioned above correspond to steps S202 to S210 in Embodiment 1. The five modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run on the computer terminal 10 provided in Embodiment 1.

[0117] According to an embodiment of this application, another apparatus embodiment for implementing the above-described file processing method is also provided. The apparatus includes: a training unit, a parsing unit, an acquisition unit, a setting unit, a determining unit, and a processing unit, wherein:

[0118] The training unit is used to train a neural network model using multiple sets of training data through machine learning. Each set of training data includes: the text content of the border data to be trained and the text content of the adjacent border data, as well as the labeled classification of the text content of the border data to be trained. The parsing unit is used to parse form text information from the file to be parsed. The form text information includes: the text content and position information of some or all border data contained in the form. The acquisition unit is used to acquire the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data based on the position information. The setting unit is used to set the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model, and use the neural network model to classify the text content of the border data to be identified to obtain a classification result. The determination unit is used to determine the category information of each border data in the partial or all border data based on the classification result. The processing unit is used to merge the category information and text content of each border data in the partial or all border data to obtain the target result.

[0119] It should be noted that the training unit, parsing unit, acquisition unit, setting unit, determining unit, and processing unit mentioned above correspond to steps S802 to S812 in Embodiment 1. The six modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.

[0120] According to an embodiment of this application, another apparatus embodiment for implementing the above-described file processing method is also provided. The apparatus includes: a parsing unit, an acquisition unit, a setting unit, a determining unit, and a processing unit, wherein:

[0121] The parsing unit is used to parse form text information from the file to be parsed, wherein the form text information includes: text content and position information of some or all border data contained in the form; the acquisition unit is used to acquire the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data based on the position information; the setting unit is used to set the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model, and use the neural network model to classify the text content of the border data to be identified to obtain a classification result, wherein the neural network model is a prediction model obtained by machine learning training from multiple sets of training data, and each set of training data includes: text content of the border data to be trained and text content of multiple border data adjacent to the border data to be trained, and the labeled classification of the text content of the border data to be trained; the determining unit is used to determine the category information of each border data in the partial or all border data based on the classification result; the processing unit is used to merge the category information and text content of each border data in the partial or all border data to obtain the target result.

[0122] It should be noted that the training unit, parsing unit, acquisition unit, setting unit, determining unit, and processing unit mentioned above correspond to steps S902 to S910 in Embodiment 1. The five modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.

[0123] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.

[0124] Example 3

[0125] According to an embodiment of this application, an embodiment of an electronic device is also provided, which may be any one of the computing devices in a group of computing devices. Figure 8 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application, such as... Figure 8 As shown, the electronic device includes: a processor 800 and a memory 802, wherein:

[0126] A processor 800 and a memory 802, connected to the processor 800, are configured to provide the processor with instructions to perform the following processing steps: acquiring a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain a target result.

[0127] In this embodiment of the application, the following steps are performed: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain the target result.

[0128] It is noteworthy that, in this embodiment of the application, the task of extracting form text information is transformed into the task of classifying some or all border data contained in the form text information. The task of classifying some or all border data of the form text information is directly performed, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0129] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information.

[0130] It should be noted that the preferred implementation of this embodiment can be found in the relevant description in Embodiment 1, and will not be repeated here.

[0131] Example 4

[0132] According to an embodiment of this application, an embodiment of a computer terminal is also provided. This computer terminal can be any one of a group of computer terminal devices. Optionally, in this embodiment, the aforementioned computer terminal can also be replaced with a mobile terminal or other terminal device.

[0133] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.

[0134] In this embodiment, the computer terminal described above can execute the program code for the following steps in the file processing method: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain a target result.

[0135] Optionally, Figure 9 This is a structural block diagram of another computer terminal according to an embodiment of this application, such as... Figure 9 As shown, the computer terminal may include: one or more (only one is shown in the figure) processors 902, memory 904, and peripheral interfaces 906.

[0136] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the file processing method and apparatus in this application embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the aforementioned file processing method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0137] The processor can access information and applications stored in the memory via a transmission device to perform the following steps: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain the target result.

[0138] Optionally, the processor may also execute program code that performs the following steps: obtaining the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data based on the location information; setting the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model; using the neural network model to classify the text content of the border data to be identified to obtain the classification result, wherein the neural network model is a prediction model trained by machine learning from multiple sets of training data, and each set of training data includes: the text content of the border data to be trained and the text content of the adjacent border data of the border data to be trained, and the labeled classification of the text content of the border data to be trained.

[0139] Optionally, the processor may also execute program code that performs the following steps: using the neural network model to convert the text content of the bounding box data to be identified and the text content of the adjacent bounding box data into multiple vector representations; concatenating the multiple vector representations to obtain the vector representation to be identified; and determining the classification result based on the vector representation to be identified.

[0140] Optionally, the processor may also execute program code that performs the following steps: performs character vectorization processing on the neural network model to convert the text content of the bounding box data to be identified and the text content of the adjacent bounding box data to obtain a first processing result; inputs the first processing result into the convolutional neural network model and outputs a second processing result; performs max pooling processing on the second processing result to obtain the multiple vector representations.

[0141] Optionally, the processor can also execute program code that performs the following steps: passing the multiple vector representations above through a feedforward network model and the output layer of the classification task to obtain the classification result.

[0142] Optionally, the processor may also execute program code that performs the following steps: setting the text content of the bounding box data to be trained and the text content of the adjacent bounding box data of the bounding box data to be trained as input parameters of the neural network model; using the neural network model to classify the text content of the bounding box data to be identified to obtain the classification probability of the text content of the bounding box data to be trained; comparing the classification probability with the labeled classification and determining the error through a loss function; and updating the network parameters of the neural network model based on the error.

[0143] This application provides a file processing solution. The process involves: acquiring a file to be parsed; parsing the file to obtain form text information, which includes the text content and position information of some or all border data contained in the form; classifying the border data to obtain a classification result; determining the category information of the border data based on the classification result; and merging the category information and text content of the border data to obtain the target result.

[0144] It is noteworthy that, in this embodiment of the application, the task of extracting form text information is transformed into the task of classifying some or all border data contained in the form text information. The task of classifying some or all border data of the form text information is directly performed, and the category information of some or all border data is determined based on the classification results. Finally, the category information of the above-mentioned some or all border data and the text content are merged to obtain the form recognition result.

[0145] Therefore, the embodiments of this application achieve the goal of automatically extracting and recognizing form text information while reducing manual input and improving recognition performance. They also achieve the technical effect of improving the accuracy and coverage of form text extraction and recognition, and are more robust, with higher business application value. This solves the technical problem that traditional rule-based automatic recognition and extraction systems in the prior art often rely on a large number of rules set manually in advance, which are difficult to adapt to the flexible format of two-dimensional forms, and have low accuracy and coverage of extracted and recognized information.

[0146] Those skilled in the art will understand that Figure 9 The structure shown is for illustrative purposes only. The computer terminal can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a mobile internet device (MID), a PAD, and other terminal devices. Figure 9 This does not limit the structure of the aforementioned electronic devices. For example, a computer terminal may also include components that are more... Figure 9 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 9 The different configurations shown.

[0147] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable non-volatile storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0148] Example 5

[0149] According to an embodiment of this application, an embodiment of a non-volatile storage medium is also provided. Optionally, in this embodiment, the aforementioned non-volatile storage medium can be used to store the program code executed by the file processing method provided in the above embodiment.

[0150] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0151] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining a file to be parsed; parsing the file to be parsed to obtain form text information, wherein the form text information includes: text content and position information of some or all border data contained in the form; classifying the some or all border data to obtain a classification result; determining the category information of the some or all border data based on the classification result; and merging the category information and text content of the some or all border data to obtain a target result.

[0152] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data based on the location information; setting the text content of the border data to be identified and the text content of the adjacent border data as input parameters of the neural network model; using the neural network model to classify the text content of the border data to be identified to obtain the classification result, wherein the neural network model is a prediction model obtained by machine learning training from multiple sets of training data, and each set of training data includes: the text content of the border data to be trained and the text content of the adjacent border data of the border data to be trained, and the labeled classification of the text content of the border data to be trained.

[0153] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: using the above-described neural network model to convert the text content of the border data to be identified and the text content of the adjacent border data into multiple vector representations; concatenating the multiple vector representations to obtain the vector representation to be identified; and determining the classification result based on the vector representation to be identified.

[0154] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: performing character vectorization processing on the text content of the border data to be identified and the text content of the adjacent border data in the neural network model to obtain a first processing result; inputting the first processing result into the convolutional neural network model to output a second processing result; performing max pooling processing on the second processing result to obtain the multiple vector representations.

[0155] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: passing the above multiple vector representations through a feedforward network model and a classification task output layer to obtain classification results.

[0156] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: setting the text content of the bounding box data to be trained and the text content of the adjacent bounding box data of the bounding box data to be trained as input parameters of the neural network model; using the neural network model to classify the text content of the bounding box data to be identified to obtain the classification probability of the text content of the bounding box data to be trained; comparing the classification probability with the labeled classification and determining the error through a loss function; and updating the network parameters of the neural network model based on the error.

[0157] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0158] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0159] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0160] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0161] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0162] If the aforementioned integrated units are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0163] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A file processing method, characterized in that, include: Get the file to be parsed; The file to be parsed is parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form; The partial or all border data are classified to obtain a classification result, wherein the classification result is based on the text content of the border data to be identified and the text content of the adjacent border data of the border data to be identified, and the border data to be identified and the adjacent border data are obtained from the partial or all border data according to the position information. Based on the classification results, determine the category information of some or all of the border data; The category information and text content of some or all of the border data are merged to obtain the target result.

2. The file processing method according to claim 1, characterized in that, The classification process is performed on some or all of the border data to obtain the classification results, including: Based on the location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data; The text content of the border data to be identified and the text content of the adjacent border data are set as input parameters of the neural network model. The neural network model is used to classify the text content of the border data to be identified to obtain the classification result. The neural network model is a prediction model trained by machine learning from multiple sets of training data. Each set of training data includes: the text content of the border data to be trained and the text content of the adjacent border data of the border data to be trained, and the labeled classification of the text content of the border data to be trained.

3. The file processing method according to claim 2, characterized in that, The neural network model is used to classify the text content of the border data to be identified, and the classification results include: The neural network model is used to convert the text content of the border data to be identified and the text content of the adjacent border data into multiple vector representations. The multiple vector representations are concatenated to obtain the vector representation to be identified; The classification result is determined based on the vector representation to be identified.

4. The file processing method according to claim 3, characterized in that, Using the neural network model, the text content of the border data to be identified and the text content of the adjacent border data are converted into the multiple vector representations, including: The neural network model performs character vectorization on the text content of the border data to be identified and the text content of the adjacent border data to obtain the first processing result. The first processing result is input into the convolutional neural network model, and the second processing result is output. The second processing result is subjected to max pooling to obtain the multiple vector representations.

5. The document processing method according to claim 3, characterized in that, Determining the classification result based on the vector representation to be identified includes: The multiple vector representations are passed through a feedforward network model and a classification task output layer to obtain the classification result.

6. The file processing method according to claim 2, characterized in that, The method further includes: The text content of the border data to be trained and the text content of the adjacent border data of the border data to be trained are set as the input parameters of the neural network model. The neural network model is used to classify the text content of the border data to be identified, and the classification probability of the text content of the border data to be trained is obtained. The classification probability is compared with the labeled classification, and the error is determined by a loss function; The network parameters of the neural network model are updated based on the error.

7. The document processing method according to claim 1, characterized in that, The method is applied in the customs declaration process for import and export to identify the form text information contained in the customs declaration documents.

8. A file processing method, characterized in that, include: A neural network model is obtained by training multiple sets of training data through machine learning. Each set of training data includes: the text content of the border data to be trained and the text content of the adjacent border data of the border data to be trained, and the annotation and classification of the text content of the border data to be trained. The form text information is obtained by parsing the file to be parsed, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form; Based on the location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data; The text content of the border data to be identified and the text content of the adjacent border data are set as input parameters of the neural network model. The neural network model is used to classify the text content of the border data to be identified to obtain the classification result. Based on the classification results, determine the category information of each border data in the partial or all border data; The category information and text content of each border data in the partial or complete border data are merged to obtain the target result.

9. A file processing method, characterized in that, include: The form text information is obtained by parsing the file to be parsed, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form; Based on the location information, obtain the border data to be identified and the adjacent border data of the border data to be identified from the partial or all border data; The text content of the border data to be identified and the text content of the adjacent border data are set as input parameters of the neural network model. The neural network model is used to classify the text content of the border data to be identified to obtain a classification result. The neural network model is a prediction model trained by machine learning from multiple sets of training data. Each set of training data includes: the text content of the border data to be trained and the text content of multiple border data adjacent to the border data to be trained, and the labeled classification of the text content of the border data to be trained. Based on the classification results, determine the category information of each border data in the partial or all border data; The category information and text content of each border data in the partial or complete border data are merged to obtain the target result.

10. A document processing device, characterized in that, include: The acquisition module is used to acquire the file to be parsed. The parsing module is used to parse the file to be parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form; A classification module is used to classify the partial or all border data to obtain a classification result, wherein the classification result is based on the text content of the border data to be identified and the text content of the adjacent border data of the border data to be identified, and the border data to be identified and the adjacent border data are obtained from the partial or all border data according to the position information. The determination module is used to determine the category information of some or all of the border data based on the classification result; The merging module is used to merge the category information and text content of some or all of the border data to obtain the target result.

11. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein, when the program is executed, it controls the device where the non-volatile storage medium is located to perform the file processing method according to any one of claims 1 to 9.

12. An electronic device, characterized in that, include: processor; as well as A memory, connected to the processor, for providing the processor with instructions to perform the following processing steps: Get the file to be parsed; The file to be parsed is parsed to obtain form text information, wherein the form text information includes: the text content and position information of some or all of the border data contained in the form; The partial or all border data are classified to obtain a classification result, wherein the classification result is based on the text content of the border data to be identified and the text content of the adjacent border data of the border data to be identified, and the border data to be identified and the adjacent border data are obtained from the partial or all border data according to the position information. Based on the classification results, determine the category information of some or all of the border data; The category information and text content of some or all of the border data are merged to obtain the target result.