Table processing method and device, electronic equipment, medium and program product
By using multiple visual encoders in the table understanding model for multi-granularity feature extraction and token conversion processing, the problems of resource consumption and low efficiency in the existing technology are solved, and the accuracy and efficiency of table processing are improved.
Patent Information
- Application Number
- CN202410870297.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
AI Technical Summary
When the existing technology handles multiple table tasks, multiple table understanding models need to be pre-trained, resulting in increased resource consumption and reduced visual processing efficiency.
Multi-granularity feature extraction is performed through multiple visual encoders in the target table understanding model, and the extracted features are converted into words in conjunction with the language processing module to improve the accuracy and processing efficiency of table understanding.
It achieves a more comprehensive capture of table structure and content information, improving the processing efficiency of table processing tasks and the reliability of results.
Smart Images

Figure CN118736593A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to a table processing method, device, electronic device, medium and program product. Background Art
[0002] In the related art, when performing table processing on an image with table information, a corresponding table understanding model is used to process the image according to the current table task, thereby obtaining a processing result corresponding to the current table task. Different table tasks correspond to different table understanding models.
[0003] Processing multiple table tasks in this way will not only increase resource consumption costs, but also reduce visual processing efficiency. Summary of the invention
[0004] In view of this, the present disclosure provides a form processing method, device, electronic device, medium and program product to solve the problem of low efficiency in form processing.
[0005] In a first aspect, the present disclosure provides a table processing method, the method comprising:
[0006] Obtain the target table image and corresponding prompt text of the target table processing task;
[0007] Input the target table image and the prompt text into the target table understanding model, determine the first word set corresponding to the prompt text, and use multiple visual encoders in the target table understanding model to perform feature extraction of multiple feature extraction granularities on the target table image to obtain image features of multiple feature granularities, perform word-gram conversion processing on the image features of the multiple feature granularities to obtain a second word set, and use the language processing module in the target table understanding model to process the first word set and the second word set to obtain a processing result of the target table processing task, where the visual encoders correspond to the feature extraction granularities one by one;
[0008] Displays the processing results.
[0009] In a second aspect, the present disclosure provides a table processing device, the device comprising:
[0010] A first acquisition module is used to acquire a target table image and a corresponding prompt text of a target table processing task;
[0011] a processing module, used for inputting a target table image and a prompt text into a target table understanding model, determining a first word-gram set corresponding to the prompt text, and using a plurality of visual encoders in the target table understanding model to respectively perform feature extraction of a plurality of feature extraction granularities on the target table image to obtain image features of a plurality of feature granularities, performing word-gram conversion processing on the image features of the plurality of feature granularities to obtain a second word-gram set, and using a language processing module in the target table understanding model to process the first word-gram set and the second word-gram set to obtain a processing result of the target table processing task, wherein the visual encoders correspond to the feature extraction granularities one to one;
[0012] The display module is used to display the processing results.
[0013] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the table processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the table processing method of the first aspect or any corresponding embodiment thereof.
[0015] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the table processing method of the first aspect or any corresponding embodiment thereof.
[0016] The table processing method provided in this embodiment can more comprehensively capture the structure and content information of the table by extracting image features from multiple feature extraction granularities through multiple visual encoders in the target table understanding model, and then process the first word set corresponding to the prompt text and the second word set corresponding to the image features of multiple feature granularities through the language processing module, which can improve the accuracy of table understanding, thereby effectively improving the processing efficiency of the target table processing task. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a flowchart of a table processing method provided according to an embodiment of the present disclosure;
[0019] Figure 2 is a flowchart of a method for training a target table understanding model provided in an embodiment of the present disclosure;
[0020] Figure 3 is a schematic diagram of the structure of an initial table understanding model provided according to an embodiment of the present disclosure;
[0021] Figure 4 is a structural block diagram of a table processing device provided according to an embodiment of the present disclosure;
[0022] Figure 5 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0024] In the related art, when performing table processing on an image with table information, a corresponding table understanding model is used to process the image according to the current table task, thereby obtaining a processing result corresponding to the current table task. The table task corresponds to the table understanding model one by one.
[0025] To process table tasks in this way, multiple table understanding models need to be pre-trained and stored, which not only increases resource consumption costs but also reduces visual processing efficiency.
[0026] In view of this, the embodiments of the present disclosure provide a table processing method, which performs multi-granular feature extraction and word-gram conversion processing on the target table image through multiple visual encoders in the target table understanding model, so that the language processing model can fully understand the table content in the target table image and the text content of the prompt text according to the second word-gram set corresponding to the obtained image features and the first word-gram set of the prompt text, and then perform targeted processing, which can not only improve the accuracy of table understanding, but also help to improve the task processing efficiency and the reliability of processing results.
[0027] According to an embodiment of the present disclosure, a table processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] In this embodiment, a table processing method is provided, which can be used in the above-mentioned electronic devices, such as mobile phones, tablet computers, etc. Figure 1 is a flowchart of a table processing method according to an embodiment of the present disclosure. Figure 1 As shown, the process includes the following steps:
[0029] Step S101, obtaining a target table image and corresponding prompt text of a target table processing task.
[0030] The target table processing task refers to the table task to be processed and understood. Among them, the target table processing task can be a table perception task or a table understanding task. For example: table perception tasks can include but are not limited to table detection, table extraction, table classification and other tasks. Table understanding tasks can include but are not limited to table structure analysis, table query, table question and answer and other tasks. The specific tasks corresponding to the target table processing task can be determined according to the task requirements and application scenarios.
[0031] The target table image is an image related to the target table processing task, which contains table information to be analyzed and understood.
[0032] The prompt text is text information related to the target table image, which is used to provide additional context or guidance related to the target table processing task, so that the target table understanding model can better understand the task requirements of the target table processing task and the table information in the target table image. The text content in the prompt text can be set according to the task requirements. For example, if the target table processing task is a table detection task, the text content in the prompt text can be "Please point out the location area of the table in this image." If the target table processing task is a table structure parsing task, the text content in the prompt text can be "Please parse the structural information of the cropped table in this image." If the target table processing task is a table query task, the text content in the prompt text can be "Please parse the table structure in the area [0.095, 0.673, 0.869, 0.851] in this image." If the target table processing task is a table question-answering task, the text content in the prompt text can be "What is the lowest stock price in the fourth quarter of 2010?".
[0033] Step S102, input the target table image and the prompt text into the target table understanding model, determine the first word set corresponding to the prompt text, and use multiple visual encoders in the target table understanding model to perform feature extraction at multiple feature extraction granularities on the target table image to obtain image features at multiple feature granularities, perform word-gram conversion processing on the image features at multiple feature granularities to obtain a second word set, and use the language processing module in the target table understanding model to process the first word set and the second word set to obtain the processing result of the target table processing task.
[0034] The target table understanding model refers to a multimodal language model used to process and understand table images. The target table understanding model can automatically determine the target table processing task to be executed based on the currently input target table image and the corresponding prompt text, and then perform targeted processing, thereby effectively saving model selection time and improving the processing efficiency of the target table processing task.
[0035] In the target table understanding model, in order to understand the text content of the prompt text, the prompt text is segmented to determine the first word set corresponding to the prompt text, so as to use the first word set to understand the prompt text in a targeted manner. In order to understand the table information in the target table image, multiple visual encoders are used to extract features of multiple feature extraction granularities on the target table image respectively, so as to capture the image information in the target table image from multiple levels or dimensions, and then obtain image features of multiple feature granularities that can characterize the content of the target table image. In order to enable the language processing module to better understand the image content of the target table image, the image features of multiple feature granularities are subjected to word gram conversion processing to obtain a second word set that can be processed by the language processing module, and then combined with the first word set of the prompt text, they are comprehensively processed by the language processing module, so that the table information and text content can be better integrated, thereby effectively improving the language processing model's understanding accuracy of the target table image and the efficiency of task processing, so that the processing result of the target table processing task can better meet the task requirements of the target table processing task. Among them, the visual encoder corresponds to the feature extraction granularity one by one.
[0036] Step S103, display the processing result.
[0037] In order to facilitate users to intuitively view the processing status of the target table understanding model in executing the target table processing task, the processing results are displayed after they are obtained, so that users can clearly understand the understanding status of the target table understanding model based on the displayed processing results, thereby enhancing the interactivity between the user and the target table understanding model.
[0038] The table processing method provided in this embodiment can more comprehensively capture the structure and content information of the table by extracting image features from multiple feature extraction granularities through multiple visual encoders in the target table understanding model, and then process the first word set corresponding to the prompt text and the second word set corresponding to the image features of multiple feature granularities through the language processing module, which can improve the accuracy of table understanding, thereby effectively improving the processing efficiency of the target table processing task.
[0039] In some optional embodiments, the plurality of visual encoders include a first visual encoder and a second visual encoder, the resolution of the second visual encoder is greater than the resolution of the first visual encoder, and then the target table image is subjected to feature extraction by visual encoders of different resolutions, so that the obtained table information can be more complete and more helpful in improving the efficiency of table understanding. Among them, the resolution refers to the number of pixels in the image, which is usually expressed as the number of horizontal pixels multiplied by the number of vertical pixels. The higher the resolution, the richer the detail information captured in the target table image.
[0040] In some optional implementation scenarios, the process of performing feature extraction at multiple feature extraction granularities by using multiple visual encoders may include:
[0041] Step a1, extracting global features of the target table image through a first visual encoder;
[0042] Step a2, extracting detail features of the target table image through a second visual encoder;
[0043] Step a3, concatenating the global features and the detail features to obtain image features of multiple feature granularities of the target table image.
[0044] Specifically, in order to fully understand the table information in the target table image, a first visual encoder with a relatively low resolution is used to perform feature extraction processing on the target table image to obtain global features that can characterize the global information of the target table image, thereby helping to improve the feature extraction efficiency.
[0045] By performing feature extraction processing on the target table image using a second visual encoder with a relatively high resolution, it is possible to capture relatively more detailed and fine structural information in the target table image, and thus obtain detailed features of the target table image.
[0046] The global features and detail features are spliced together to make the image features of multiple feature granularities of the target table image more comprehensive and complete, and can represent the table information in the target table image from different feature granularities, thereby helping to improve the overall image processing performance.
[0047] In some other optional implementations, the process of obtaining the second word-gram set is as follows:
[0048] Step b1, inputting the image features of the current granularity into the mapping layer corresponding to the current granularity in the target table understanding model to perform word unit conversion processing, and obtaining a second word unit subset corresponding to the image features of the current granularity;
[0049] Step b2: concatenate the second word-meta subset corresponding to the image features of the current granularity with the second word-meta subset corresponding to the image features of other granularities to obtain a second word-meta set.
[0050] Specifically, in order to facilitate the language processing module to understand the image features representing the table information, the image features of the current granularity are input into the mapping layer corresponding to the current granularity in the target table understanding model, and the word-meta conversion processing is performed through the mapping layer to obtain the second word-meta subset corresponding to the image features of the current granularity. The second word-meta subset can be regarded as the word-meta expression of the image features of the current granularity, which can represent the semantic information in the image features of the current granularity.
[0051] In order to improve the overall understanding of the target table image, a corresponding mapping layer is set for each visual encoder in the target table understanding model, so that the accuracy of understanding can be improved and the occurrence of misrecognition can be reduced when performing word unit conversion processing. Therefore, after obtaining the second word unit subset corresponding to the image features of the current granularity and the second word unit subset corresponding to the image features of other granularities, multiple second word unit subsets are spliced, so that the second word unit set can comprehensively represent the semantic information of the entire target table image, so that the subsequent language processing module can capture different levels of details and semantic information when performing table understanding based on the second word unit set, and improve the understanding and analysis capabilities of the table image.
[0052] In some other optional implementations, the process of using the language processing module in the target table understanding model to process the first word set and the second word set to obtain the processing result of the target table processing task may be as follows:
[0053] Step c1, concatenating the first word-gram set and the second word-gram set with the preset task-guiding word-gram to obtain a word-gram set to be processed;
[0054] Step c2, using the language processing module in the target table understanding model to process the word set to be processed, to obtain the processing result of the target table processing task.
[0055] Specifically, the task-guiding word element is used to guide the identification of the target table processing task, so that when the language processing model understands and processes the first word element set and the second word element set, it can more clearly understand the requirements and key points of the target table processing task, and then can perform more targeted processing, so as to improve the accuracy and efficiency of the processing results. For example, if the target table processing task is to identify specific fields or data in a table, the task-guiding word element may contain vocabulary or prompt information related to these fields, and then, when the language processing module processes the word element set to be processed, it can pay more attention to the part related to the target task according to the instructions of the task-guiding word element. The definition and design method of the specific task-guiding word element will affect its targeted guidance. In some examples, the preset task-guiding word element can correspond to a variety of table tasks.
[0056] By concatenating the first word set and the second word set with the task guiding word set, and using the language processing module to process the concatenated word set to be processed, accurate and effective processing of the target table processing task can be achieved, which can improve the guidance, comprehensiveness and language comprehension ability of the target table understanding model, thereby providing more reliable and useful processing results for various table tasks, and helping to improve the practicality and reliability of the model.
[0057] In some optional implementations, the above step S103 includes:
[0058] Step d1, determining a target output format corresponding to a target table processing task according to a first corresponding relationship between preset table tasks and output formats;
[0059] Step d2, displaying the processing result based on the target output format.
[0060] Specifically, in order to ensure the orderliness and standardization of the output of the processing results, the corresponding output format is configured for each table task in advance so that the processing results can be displayed more reasonably. Therefore, the first corresponding relationship is constructed in advance. For example, if the target table processing task is to generate a report, the preset first corresponding relationship may specify the format of the report, such as row and column layout, title, data format, etc. Then, when the corresponding target table processing task is clear, the target output format corresponding to the target table processing task can be quickly determined, so that the processing results of the target table processing task are output in a targeted manner according to the target output format, so that users can view and understand the results in the desired way, and quickly obtain key information from it, which is conducive to improving the efficiency of information communication.
[0061] Moreover, through the preset first correspondence, it can be ensured that the same table tasks can display the processing results in a consistent target output format, so that users do not need to spend time and energy to process and convert the format of the processing results, and can directly focus on understanding and analyzing the processing results, thereby effectively improving work efficiency and effectiveness.
[0062] For example, the preset output format can be the format of "table position + current line terminator". The current line terminator can be represented by " / n". Or: the preset output format can be the format of "table type + table position + current line terminator" to display the processing results. The output format corresponding to each table task can be set according to the requirements.
[0063] Based on the same inventive concept, the present invention also provides a method for training a target table understanding model. Figure 2 is a flowchart of a method for training a target table understanding model according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0064] Step S201, obtaining multiple training sets.
[0065] The training set corresponds to the table task one by one, and includes table image samples and corresponding prompt text samples corresponding to the table task. By obtaining multiple training sets, the initial table understanding model can learn the differences and internal connections between different table tasks during the training process, thereby improving the generalization ability of the model.
[0066] Step S202, inputting multiple training sets into the initial table understanding model in sequence, adjusting the initial model parameters of the initial table understanding model based on the first parameter of the first visual encoder and the second parameter of the language processing module, and obtaining a target table understanding model.
[0067] Inputting multiple training sets into the initial table understanding model in sequence can enable the initial table understanding model to learn based on samples of different table tasks during the training process.
[0068] During the training process, the initial table understanding model will perform calculations and outputs based on the input and existing parameters, and then reach a convergence state by continuously adjusting its own initial model parameters to obtain the target table understanding model.
[0069] Since the first visual encoder is the visual encoder with the smallest resolution among the multiple visual encoders, it can be used to extract the visual encoder of the global features of the table image sample / target table image when performing feature processing on the table image sample / target table image. Therefore, during the training process, in order to improve the training efficiency, the first parameter of the first visual encoder can be used as a fixed parameter, and then the second parameter of the language processing module can be used to guide the learning of the initial table understanding model, so that the initial table understanding model can better adapt to and understand the table data, and the training cycle can be greatly shortened, so that by continuously adjusting and improving the initial model parameters of the initial table understanding model, a target model that can accurately understand the table information and perform a variety of different table tasks can be obtained.
[0070] The table processing method provided in this embodiment adjusts the initial model parameters of the initial table understanding model based on the first parameter of the first visual encoder and the second parameter of the language processing module, which can ensure that the initial table understanding model can efficiently learn and understand different table information and text content during the training process, and then by continuously inputting training sets and optimizing model parameters, the final target table understanding model can automatically recognize and understand a variety of table tasks, thereby effectively improving the flexibility and generalization ability of the target table understanding model.
[0071] In some optional embodiments, such as Figure 3 In the initial table understanding model shown, the multiple visual encoders further include a second visual encoder, the initial table understanding model further includes a first mapping layer corresponding to the first visual encoder and a second mapping layer corresponding to the second visual encoder, the first mapping layer is used to perform word unit conversion processing on the image features output by the first visual encoder, and the second mapping layer is used to perform word unit conversion processing on the image features output by the second visual encoder, and the above step S202 includes:
[0072] Step e1, inputting multiple training sets into the initial table understanding model in sequence, adjusting the initial model parameters of the initial table understanding model based on the first parameter of the first visual encoder and the second parameter of the language processing module, and obtaining an intermediate table understanding model.
[0073] In order to align the output features of the visual encoder with the latent space of the language processing module, the initial model parameters of the initial table understanding model are adjusted by continuously inputting training using the first parameters based on the first visual encoder and the second parameters of the language processing module to obtain an intermediate table understanding model.
[0074] Step e2, determining the third parameter of the second visual feature module, the fourth parameter of the first mapping layer, and the fifth parameter of the second mapping layer through the intermediate table understanding model.
[0075] After the intermediate table understanding model is obtained, the third parameter of the second visual feature module, the fourth parameter of the first mapping layer, and the fifth parameter of the second mapping layer can be determined according to the model parameters of the intermediate table understanding model. For example, the determination is made by manually adjusting or using an automated machine learning algorithm to search for optimal parameter values. Since the selection of the above parameters will directly affect the model's ability to understand and process table data, further optimization is required.
[0076] Step e3, inputting multiple training sets into the intermediate table understanding model, adjusting the second parameter, the third parameter, the fourth parameter and the fifth parameter based on the first parameter of the first visual encoder, and obtaining the target table understanding model.
[0077] Multiple training sets are input into the intermediate table understanding model, and the second parameter, the third parameter, the fourth parameter and the fifth parameter are adjusted by using the first parameter of the first visual encoder to further optimize and adjust the model parameters of the intermediate table understanding model, and then by continuously adjusting these parameters, the trained target table understanding model can perform table understanding tasks more comprehensively and efficiently, and can better process various complex table data, thereby achieving the purpose of improving the accuracy and robustness of the model.
[0078] In other optional embodiments, the process of adjusting the initial model parameters of the initial table understanding model also includes: training in combination with preset task-guided word units, so that the initial table understanding model / intermediate table understanding model can conduct targeted learning on the understanding characteristics and processing characteristics of each table task during the learning process, thereby enhancing the ability to understand and process a variety of table tasks, which helps to enhance the robustness and accuracy of the final target table understanding model.
[0079] In some further optional implementations, the above step S201 includes:
[0080] Step f1, determining the target annotation type corresponding to the current table task according to the second corresponding relationship between the preset table tasks and the annotation types.
[0081] Step f2, obtaining the initial sample set corresponding to the current table task.
[0082] Step f3: annotate the initial sample set according to the target annotation type to obtain a training set corresponding to the current table task.
[0083] Specifically, in order to enhance the table comprehension ability of the target table comprehension model and adapt to the application scenarios of various table tasks, a second correspondence between table tasks and annotation types is established in advance to uniformly and standardizedly annotate the initial sample sets corresponding to each table task, thereby making the annotation work more targeted and improving the accuracy and efficiency of annotation. The second correspondence between table tasks and annotation types can be set according to needs.
[0084] For example: table tasks may include table detection (TD), table structure recognition (TSR), table question answering (TQA), and table question answering with analysis (TAR). After obtaining the initial sample sets corresponding to each table task, in order to clarify the table tasks to be performed corresponding to each initial sample set, they are labeled according to the target annotation type corresponding to each table task to obtain the sample sets corresponding to each table task. In order to enable the initial table understanding model to conduct targeted learning on the corresponding table tasks based on the annotations of each sample set during subsequent training, the purpose of enhancing the table understanding ability is achieved.
[0085] In some optional implementation scenarios, the type of sample set is not limited to any of the following: a general data table set (e.g., PubTables-1M), a dataset for financial table understanding (e.g., FinTabNet), a large-scale end-to-end table extraction dataset from scientific articles (e.g., PubTabNet), a large-scale dataset for table fact checking (e.g., TabFact), etc.
[0086] The correspondence between the table task and the annotated sample set can be shown in Table 1 below. Among them, if the initial sample set is a general table data set (PubTables-1M), the sample set (Dataset) annotated according to the target annotation type corresponding to the table task (Task) may include multiple sample subsets (Subset). For example: if the current table task is TD, the corresponding sample subset may be PubTab1M-Det (a general table data set for table detection). If the current table task is TSR, the corresponding sample subset may be PubTab1M-Str (a general table data set for table structure recognition). If the current table task is TQ, the corresponding sample subset may be PubTab1M-Syn (annotated general table data set).
[0087] Table 1
[0088]
[0089] By setting a variety of table tasks and annotation types, the processing requirements of different types of table tasks can be met, and then the model can be trained using the training set after targeted annotation, which can effectively increase the flexibility and applicability of the model, thereby achieving the purpose of improving the performance and application effect of the target table understanding model.
[0090] As one or more specific application embodiments of the embodiments of the present disclosure, taking the target table processing task as table detection as an example, when the acquired target table image includes two tables, and the corresponding prompt text is "Show the location of the table elements in this image", the processing result obtained by the target table understanding model processing is "The following is a list of the locations of all table elements in the image:
[0091] [0.094,0.143,0.487,0.612]\n
[0092] [0.510,0.143,0.903,0.646]".
[0093] Taking the target table processing task as table understanding as an example, when the target table image obtained is a stock price trend analysis table, and the corresponding prompt text is "What is the lowest stock price in the fourth quarter of 2010?", the processing result obtained by the target table understanding model processing can be "The lowest stock price in the fourth quarter of 2010 is $xx.xx."
[0094] In this embodiment, a table processing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0095] This embodiment provides a table processing device, such as Figure 4 As shown, including:
[0096] The first acquisition module 401 is used to acquire a target table image and a corresponding prompt text of a target table processing task;
[0097] The processing module 402 is used to input the target table image and the prompt text into the target table understanding model, determine the first word set corresponding to the prompt text, and use multiple visual encoders in the target table understanding model to perform feature extraction of multiple feature extraction granularities on the target table image to obtain image features of multiple feature granularities, perform word-gram conversion processing on the image features of the multiple feature granularities to obtain a second word set, and use the language processing module in the target table understanding model to process the first word set and the second word set to obtain a processing result of the target table processing task, wherein the visual encoders correspond to the feature extraction granularities one by one;
[0098] The display module 403 is used to display the processing results.
[0099] In some optional embodiments, the plurality of visual encoders include a first visual encoder and a second visual encoder, and a resolution of the second visual encoder is greater than a resolution of the first visual encoder;
[0100] The processing module 402 includes:
[0101] A first extraction unit, configured to extract global features of a target table image through a first visual encoder;
[0102] A second extraction unit, used for extracting detail features of the target table image through a second visual encoder;
[0103] The first splicing unit is used to splice the global features and the detail features to obtain image features of multiple feature granularities of the target table image.
[0104] In some optional implementations, the processing module 402 further includes:
[0105] A conversion unit, used for inputting the image features of the current granularity into a mapping layer corresponding to the current granularity in the target table understanding model to perform word unit conversion processing, so as to obtain a second word unit subset corresponding to the image features of the current granularity;
[0106] The second concatenation unit is used to concatenate the second word-unit subset corresponding to the image feature of the current granularity with the second word-unit subset corresponding to the image feature of other granularities to obtain a second word-unit set.
[0107] In some optional implementations, the processing module 402 further includes:
[0108] A third concatenation unit is used to concatenate the first word-gram set and the second word-gram set with a preset task-guiding word-gram to obtain a word-gram set to be processed, wherein the task-guiding word-gram is used to guide the recognition target table processing task;
[0109] The first processing unit is used to process the word set to be processed by using the language processing module in the target table understanding model to obtain a processing result of the target table processing task.
[0110] In some optional implementations, the display module 403 includes:
[0111] A second processing unit, configured to determine a target output format corresponding to a target table processing task according to a first corresponding relationship between preset table tasks and output formats;
[0112] The third processing unit is used to display the processing result based on the target output format.
[0113] In some optional embodiments, the training device of the target table comprehension model includes:
[0114] A second acquisition module is used to acquire multiple training sets, where the training sets correspond to the table tasks one by one, and the training sets include table image samples corresponding to the table tasks and corresponding prompt text samples;
[0115] A training module is used to input multiple training sets into the initial table understanding model in sequence, adjust the initial model parameters of the initial table understanding model based on the first parameter of the first visual encoder and the second parameter of the language processing module, and obtain a target table understanding model. The first visual encoder is the visual encoder with the smallest resolution among the multiple visual encoders.
[0116] In some optional embodiments, the multiple visual encoders further include a second visual encoder, the initial table comprehension model further includes a first mapping layer corresponding to the first visual encoder and a second mapping layer corresponding to the second visual encoder, the first mapping layer is used to perform word unit conversion processing on the image features output by the first visual encoder, and the second mapping layer is used to perform word unit conversion processing on the image features output by the second visual encoder;
[0117] The training modules include:
[0118] A first execution unit is used to sequentially input the multiple training sets into the initial table understanding model, and adjust the initial model parameters of the initial table understanding model based on the first parameter of the first visual encoder and the second parameter of the language processing module to obtain an intermediate table understanding model;
[0119] A second execution unit, configured to determine a third parameter of the second visual feature module, a fourth parameter of the first mapping layer, and a fifth parameter of the second mapping layer through the intermediate table understanding model;
[0120] The third execution unit is used to input multiple training sets into the intermediate table understanding model, and adjust the second parameter, the third parameter, the fourth parameter and the fifth parameter based on the first parameter of the first visual encoder to obtain the target table understanding model.
[0121] In some optional implementations, the process of adjusting the initial model parameters of the initial table comprehension model further includes: training in combination with preset task-guided word units.
[0122] In some optional implementations, the second acquisition module includes:
[0123] A fourth execution unit, configured to determine a target annotation type corresponding to a current table task according to a preset second correspondence between table tasks and annotation types;
[0124] A sample acquisition unit, used to acquire an initial sample set corresponding to the current table task;
[0125] The labeling unit is used to label the initial sample set according to the target labeling type to obtain a training set corresponding to the current table task.
[0126] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0127] The table processing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0128] The present disclosure also provides an electronic device having the above Figure 4 The form processing device shown.
[0129] See also Figure 5 , Figure 5 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present disclosure, such as Figure 5As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.
[0130] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0131] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0132] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0133] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0134] The electronic device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0135] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0136] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0137] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0138] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0139] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0140] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0141] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0142] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A table processing method, characterized in that: The method comprises: Obtain the target table image and corresponding prompt text of the target table processing task; Input the target table image and the prompt text into a target table understanding model, determine a first word-gram set corresponding to the prompt text, and use a plurality of visual encoders in the target table understanding model to perform feature extraction of a plurality of feature extraction granularities on the target table image to obtain image features of a plurality of feature granularities, perform word-gram conversion processing on the image features of the plurality of feature granularities to obtain a second word-gram set, and use a language processing module in the target table understanding model to process the first word-gram set and the second word-gram set to obtain a processing result of the target table processing task, wherein the visual encoder corresponds to the feature extraction granularity one by one; The processing result is displayed.
2. The method according to claim 1, characterized in that The multiple visual encoders include a first visual encoder and a second visual encoder, wherein a resolution of the second visual encoder is greater than a resolution of the first visual encoder; The method of using the multiple visual encoders in the target table understanding model to perform feature extraction of multiple feature extraction granularities on the target table image to obtain image features of multiple feature granularities includes: Extracting global features of the target table image by the first visual encoder; Extracting detail features of the target table image by the second visual encoder; The global features and the detail features are spliced to obtain image features of the target table image at the multiple feature granularities.
3. The method according to claim 1 or 2, characterized in that: The performing word-meta mapping on the image features of the plurality of feature granularities to obtain a second word-meta set includes: Inputting the image features of the current granularity into the mapping layer corresponding to the current granularity in the target table understanding model to perform word unit conversion processing, so as to obtain a second word unit subset corresponding to the image features of the current granularity; The second word-unit subset corresponding to the image feature of the current granularity is concatenated with the second word-unit subsets corresponding to the image features of other granularities to obtain the second word-unit set.
4. The method according to claim 3, characterized in that: The using the language processing module in the target table understanding model to process the first word set and the second word set to obtain the processing result of the target table processing task includes: splicing the first word-gram set and the second word-gram set with preset task-guiding word-grams to obtain a word-gram set to be processed, wherein the task-guiding word-grams are used to guide the identification of the target table processing task; The language processing module in the target table understanding model is used to process the word set to be processed to obtain a processing result of the target table processing task.
5. The method according to claim 1, characterized in that The displaying of the processing result includes: Determining a target output format corresponding to the target table processing task according to a first corresponding relationship between a preset table task and an output format; The processing result is displayed based on the target output format.
6. The method according to claim 1, characterized in that The training method of the target table understanding model includes: Acquire multiple training sets, where the training sets correspond to the table tasks one by one, and the training sets include table image samples corresponding to the table tasks and corresponding prompt text samples; The multiple training sets are sequentially input into the initial table understanding model, and based on the first parameter of the first visual encoder and the second parameter of the language processing module, the initial model parameters of the initial table understanding model are adjusted to obtain the target table understanding model, wherein the first visual encoder is the visual encoder with the smallest resolution among the multiple visual encoders.
7. The method according to claim 6, characterized in that The multiple visual encoders further include a second visual encoder, the initial table comprehension model further includes a first mapping layer corresponding to the first visual encoder and a second mapping layer corresponding to the second visual encoder, the first mapping layer is used to perform word-gram conversion processing on the image features output by the first visual encoder, and the second mapping layer is used to perform word-gram conversion processing on the image features output by the second visual encoder; The step of sequentially inputting the plurality of training sets into the initial table comprehension model, adjusting the initial model parameters of the initial table comprehension model based on the first parameter of the first visual encoder and the second parameter of the language processing module to obtain the target table comprehension model comprises: Inputting the plurality of training sets into an initial table understanding model in sequence, and adjusting initial model parameters of the initial table understanding model based on a first parameter of the first visual encoder and a second parameter of the language processing module to obtain an intermediate table understanding model; Determining a third parameter of the second visual feature module, a fourth parameter of the first mapping layer, and a fifth parameter of the second mapping layer through the intermediate table understanding model; The multiple training sets are input into the intermediate table understanding model, and based on the first parameter of the first visual encoder, the second parameter, the third parameter, the fourth parameter and the fifth parameter are adjusted to obtain the target table understanding model.
8. The method according to claim 6 or 7, characterized in that: The process of adjusting the initial model parameters of the initial table understanding model further includes: Combine preset tasks to guide word units for training.
9. The method according to claim 8, characterized in that The obtaining of multiple training sets comprises: Determine the target annotation type corresponding to the current table task according to the second corresponding relationship between the preset table task and the annotation type; Obtaining an initial sample set corresponding to the current table task; The initial sample set is labeled according to the target labeling type to obtain a training set corresponding to the current table task.
10. A table processing device, characterized in that: The device comprises: A first acquisition module is used to acquire a target table image and a corresponding prompt text of a target table processing task; a processing module, for inputting the target table image and the prompt text into a target table understanding model, determining a first word-gram set corresponding to the prompt text, and using a plurality of visual encoders in the target table understanding model to respectively perform feature extraction of a plurality of feature extraction granularities on the target table image to obtain image features of a plurality of feature granularities, performing word-gram conversion processing on the image features of the plurality of feature granularities to obtain a second word-gram set, and using a language processing module in the target table understanding model to process the first word-gram set and the second word-gram set to obtain a processing result of the target table processing task, wherein the visual encoder corresponds to the feature extraction granularity in a one-to-one manner; The display module is used to display the processing result.
11. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the table processing method according to any one of claims 1 to 9 by executing the computer instructions.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the table processing method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the form processing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
End-to-end receipt information extraction method and device based on multiple modes and application of end-to-end receipt information extraction method and device
CN116229477A
Voice processing method and device, electronic equipment and computer readable medium
CN117174067A
Data processing method and device, equipment, storage medium and product
CN118014086A
Cited By
MTU data decoupling formation and model training method, system and device and medium
CN119832579A
Table processing method and apparatus based on multi-modal large model, and electronic device
CN120894794A
