Large model table question and answer method of table biaxial position coding and joint task loss function

By using a large-model table question-answering method with dual-axis position encoding and joint task loss function, the problems of two-dimensional table structure perception and single training target in existing technologies are solved, and more efficient table information extraction and cross-table reasoning capabilities are achieved.

CN121435989AActive Publication Date: 2026-01-30COMPUTER INNOVATION TECH RES INST OF ZHEJIANG UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202512007845.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-01-30
Estimated Expiration
2045-12-29

AI Technical Summary

Technical Problem

Existing table processing techniques cannot effectively capture the two-dimensional structure of tables, and the model training objectives are singular, resulting in insufficient accuracy and robustness in complex scenarios.

Method used

A large-scale table question answering method using dual-axis positional encoding and joint task loss function is proposed. By constructing the table using dual-axis positional encoding, multi-modal fusion, and joint loss training, the model's ability to understand and reason about the semantic and structural information of the table is enhanced.

Benefits of technology

It significantly improves the accuracy and robustness of the model in processing complex tabular data, enabling it to better understand the table structure and semantics and adapt to various task requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121435989A_ABST
    Figure CN121435989A_ABST
Patent Text Reader

Abstract

The invention discloses a table biaxial position coding and task loss function combined large model table question and answer method. Collecting table, question and answer data, and performing structuralization and biaxial position coding processing on the table data to obtain a text word vector set and biaxial position codes; performing fusion processing to obtain a position code after biaxial fusion; after combination processing, sequentially inputting into a model for processing to obtain a table global representation vector; and establishing a loss function training model, and performing prediction processing on an actual application scene by using the trained model to obtain a table answer result. According to the method, through double-axis position coding, the two-way constraint relation between rows and columns is effectively captured, representation is made to better conform to the inherent structure of a table, through mask cell modeling, known data can be learned, missing information can be speculated, the incomplete data processing capacity in a real scene is improved, and the method is suitable for being popularized and applied. The accuracy and robustness in complex table data processing can be remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, and in particular to a method for large-scale table question answering using a dual-axis positional encoding of tables and a joint task loss function. Background Technology

[0002] With the rapid development of artificial intelligence and natural language processing technologies, tables, as an important form of carrying structured data, are widely used in fields such as financial statements, scientific research papers, government archives, and e-commerce product lists. As data volumes explode, the ability to efficiently and accurately extract key information from tables and achieve intelligent question answering and cross-table reasoning has become a core requirement within the industry.

[0003] However, existing table processing techniques still suffer from two major bottlenecks, making it difficult to meet the practical needs of complex scenarios. First, traditional positional encoding cannot adapt to the two-dimensional structure of tables. Large models themselves lack positional awareness and rely on positional encoding to obtain the sequential information of elements. However, existing methods mostly use single-axis positional encoding from text processing (such as sine / cosine positional encoding and learnable positional encoding), flattening the table into a one-dimensional sequence by rows or columns before encoding. This approach completely loses the relative positional relationships of table cells in both row and column dimensions, making it difficult for the model to truly understand the structured semantics of the table and resulting in poor performance in cross-row / column association tasks.

[0004] Secondly, the training objectives of these models are singular, resulting in insufficient preservation of structural and semantic information. Current mainstream table processing models often optimize for single task metrics (such as accuracy in table question answering or F1 score in information extraction), neglecting the essential requirements of "structural integrity" and "semantic consistency" of table data. For example, some models, in an effort to improve question answering accuracy, overemphasize matching text in local cells, leading to a decline in their ability to understand the overall row and column logic of the table. In cross-table reasoning tasks, due to the lack of consideration for issues such as semantic alignment of table headers and consistency of data formats between different tables, data association errors frequently occur, significantly reducing the model's robustness.

[0005] In summary, the shortcomings of existing technologies in perceiving the two-dimensional structure of tables, designing training objectives, and merging positional encodings result in insufficient accuracy and robustness in processing complex tabular data. Therefore, there is an urgent need for a technical solution that can fully capture the two-dimensional structure of tables, balance task performance with structural semantic preservation, and adapt to the needs of multiple scenarios, in order to overcome the current technical bottlenecks. Summary of the Invention

[0006] The core objective of this invention is to address the aforementioned shortcomings of existing table processing technologies and provide a method for large-scale table question answering using dual-axis positional encoding and a joint task loss function. Through an integrated design of "dual-axis positional encoding construction - multi-mode fusion - joint loss training," it achieves in-depth mining of table structure information and comprehensive improvement of model performance.

[0007] To achieve the above-mentioned objectives, the present invention specifically adopts the following technical solution: (i) Collect tabular data and generate questions and answers related to the tables. Perform structured and dual-axis positional encoding on the tabular data to obtain the text word vector set and dual-axis positional encoding for each cell. Perform word vector processing on the question and answer data. (ii) Merge the dual-axis position codes of the cells to obtain the dual-axis merged position code PE. final ; (iii) The position code PE after merging the dual axes of the cell final After combining with the text word vector set, the input representation vector X of the cell is obtained. Then, the input representation vector X is sequentially input into a large table domain model containing a multi-layer self-attention mechanism and a feed-forward neural network to obtain the global table representation vector H. (iv) Using the global representation vector H of the table, a special loss function with table-oriented structural characteristics is constructed for the large table domain model to enhance the model's ability to understand and reason about the semantic and structural information of the table. Finally, the trained large table domain model is used to predict the table data and question text in the actual application scenario to obtain the table answer results.

[0008] The specific steps (i) are as follows: (11) Convert the input table into a structured cell sequence to obtain a set of text word vectors; (12) Optimized sine and cosine position coding is used to generate row position coding PE. row (r,c) and column position code PE col (r,c) is used as a dual-axis positional encoding.

[0009] The specific steps (11) are as follows: The process involves converting each cell of the table into a set of text word vectors, which consists of multiple text word vectors (tokens). Each cell is assigned a unique two-dimensional position index (r, c), where r and c represent the row index and column index, respectively.

[0010] The specific steps (12) are as follows: Optimized sine and cosine position coding is used to generate row position code PE. row (r,c) represents the following: PE row (r,c)=sin((r / (10000 c / dm ))*(r / max(R-1,1))), where c is an even number PE row (r,c)=cos((r / (10000 (c-1) / dm ))*(r / max(R-1,1))), where c is an odd number Where dm is the hidden layer dimension (common values ​​are 512 and 768), max() represents the maximum value function, and R represents the total number of rows; The column position code PE is generated using sine and cosine position coding, which is consistent with the row position coding. col (r,c) represents the following: PE col (r,c)=sin((c / (10000 r / dm ))*(c / max(C-1,1))), where r is an even number PE col (r,c)=cos((c / (10000 (r-1) / dm ))*(c / max(C-1,1))), where r is an odd number Where C represents the total number of columns.

[0011] In step (i), both the question and answer data are encoded and converted into a question embedding vector and an answer embedding vector, respectively. Both the question embedding vector and the answer embedding vector are composed of multiple text word vectors (tokens) for subsequent training processing.

[0012] Step (II) specifically includes: Based on line position code PE row (r,c) and column position code PE col (r,c) generates the biaxially fused position code PE according to the following formula. final As the final cell location code: PE final =αPE row (r,c)+ βPE col (r,c) Where α and β represent the row position weight and column position weight, respectively, and α + β = 1.

[0013] In step (iii), the large table domain model includes a text embedding layer and an encoder, specifically: (31) Cell input indicates construction: The set of text word vectors for each cell is input into a text embedding layer (such as a RoBERTa embedding layer) to generate a text semantic embedding vector X. text Then embed the text semantics into the vector X. text Position encoding PE after dual-axis fusion final Adding elements together, we get the cell input representing the vector X=X. text + PE final ; (32) Semantic feature extraction: The input vector X of all cells is concatenated into a sequence in the order of row first and column second, and then input into the multi-layer semantic feature extractor to output the global semantic information of the table. The semantic feature extractor captures global associations between cells through a multi-layer self-attention mechanism to obtain global contextual semantic features, including global associations such as cross-row and column cell semantic interactions and remote dependencies between table headers and data; The global contextual semantic features are then transformed nonlinearly through a feed-forward neural network, and the final output is a global representation vector H of the table that contains the two-dimensional structure information of the table and the global semantics.

[0014] In step (iii), two task losses are established for training the large table domain model. These two task losses are then combined to construct a total loss. The model is trained with the goal of minimizing this total loss to obtain the trained large table domain model. The two task losses include the table question-answering task loss L. qa Problem and header related loss L header .

[0015] The table-based question-and-answer task loss L qa Cross-entropy loss is used.

[0016] The table-based question-and-answer task loss L qa It involves fusing the global representation vector of the table output by the large table domain model with the question embedding vector and inputting it into a classifier to obtain the answer prediction result. Then, it uses cross-entropy loss to calculate the difference between the answer prediction result and the actual answer.

[0017] Extract the global representation vector of the table header from the global representation vector of the table, and use the global representation vector of the table header combined with the question embedding vector to establish the association loss between the question and the table header, L. header The problem mentioned is associated with the loss L in the table header. header Calculate according to the following formula based on the relationship between the question and the table header: L header =-(Σ M i=1 [log(esim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ))*y i ]) / M -λ*(Σ M i=1 Σ M j=1,j≠i [(log(1-P i )+log(1-P j ))*(1- y i,j )*Ⅱ(y i,j =0)]) / (M*(M-1)) P i = e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ) P j = e sim(hj,q) / τ / (Σ M j=1 e sim(hj,q) / τ ) Where M is the total number of table headers (i.e., the number of columns), hi is the global representation vector of the i-th header output by the large-scale table domain model, q is the question embedding vector, sim() is the cosine similarity function, τ is the hyperparameter coefficient, and y i For the true associated label of the i-th header (y) i =1 corresponds to the head of the answer list, y i =0 indicates that the answer list header is not included), y i,j P represents the associated label in the list header of list i and j. i Let P represent the matching probability of the i-th header. j This represents the matching probability of the j-th table header, where i and j represent the table header index, λ is the negative sample penalty weight, and Ⅱ() is the indicator function (1 if the condition in parentheses is true, 0 otherwise), Ⅱ(y i,j =0) means that 1 is taken if the head of both i and j are non-answer columns, otherwise 0 is taken; e represents the natural constant, Σ M i=1 Σ M j=1,j≠i [] indicates a pairwise combination of non-related table headers; The table header is the cell at the beginning of the table, usually the first row of the table; the global representation vector H of the cell containing the table header is used as the global representation vector of the table header.

[0018] The actual associated label of the table header is the label information within the cell containing the table header.

[0019] The first part of the above formula focuses on "the true relational header (y)".i =1) "Optimization of matching accuracy between table header and question", the core is to transform the similarity between table header and question into a probability distribution through Softmax normalization, and then use cross-entropy loss to force the matching probability of the real table header to approach 1.

[0020] 1) Molecule e sim(hi,q) / τ The similarity between the table header hi and the question q is amplified by an exponential function, and the hyperparameter coefficient τ controls the degree of amplification (the smaller τ is, the more prominent the weight of the positive sample with high similarity). 2) Denominator Σ M j=1 e sim(hj,q) / τ : Globally normalize the similarity between all table headers and questions to ensure that the output is a probability value in the range of 0-1; The first part of the formula serves to ensure that when the model is faced with a multi-header table (such as the multi-header table of "temperature", "pressure", "vibration" etc. in the industrial control sensor table), it can accurately locate the header directly related to the problem (such as the "temperature" header corresponding to the problem "has the temperature in the computer room been abnormal in the past 30 days").

[0021] The second part of the above formula is the core of optimizing the non-associative table header (y) through double constraints. i =0) Matching relationship with the question.

[0022] 1) -λ*(Σ M i=1 Σ M j=1,j≠i The outer coefficient []) / (M*(M-1)) is calculated only for pairwise combinations of "non-associative headers - non-associative headers". All pairwise combinations of non-associative headers are averaged to avoid loss bias caused by differences in the number of samples. By mining the relative relationships between non-associative headers, the pairwise combinations transform "absolute supervision of a single sample" into "relative supervision of sample pairs". The number of supervision information is expanded from M to M×(M−1) (pairwise combinations), which greatly improves the data utilization rate.

[0023] 2) (log(1-P) i )+log(1-P j By using the logarithm of "1 - the matching probability of unrelated headers", the matching probability of unrelated headers with the question is forced to approach 0, so that "unrelated headers that are more related to the question" have a higher matching probability (compared to unrelated headers that are less related), otherwise they will suffer a higher penalty.

[0024] The method of this invention first constructs positional codes for the row and column positions of table cells, and obtains dual-axis positional codes through addition, concatenation, or learnable fusion to fully capture the two-dimensional structural information of the table. Subsequently, the table content is embedded and combined with the dual-axis positional codes, and input into the model encoder for table representation learning. During model training, a joint task loss function is designed, including table question-answering task loss, masked cell modeling loss, and question-and-header association loss, to ensure that the model can complete the specific task while preserving the internal structure and semantic consistency of the table.

[0025] Compared with existing methods, the present invention has the following significant advantages: 1) Make full use of the two-dimensional structure of the table Traditional methods often only consider row sequences or flattened inputs, ignoring the two-dimensional characteristics of tables; however, this invention effectively captures the bidirectional constraint relationship between rows and columns through dual-axis position encoding, making the representation more consistent with the inherent structure of tables.

[0026] 2) Enhance model generalization and reasoning capabilities By using masked cell modeling, the model can not only learn from known data, but also infer missing information, improving its ability to handle incomplete data in real-world scenarios.

[0027] This invention utilizes a joint loss function design, enabling the model to optimize across multiple tasks while balancing semantic understanding and structural modeling, thereby achieving more comprehensive tabular representation learning.

[0028] This invention can be widely applied to application scenarios such as table information extraction, table question answering, and cross-table reasoning, and can significantly improve the accuracy and robustness of the model in complex table data processing. Attached Figure Description

[0029] Figure 1 This is the method logic diagram of the present invention. Detailed Implementation

[0030] The invention will be further described below with reference to specific implementations.

[0031] like Figure 1 As shown, the embodiments of the present invention and their implementation process are as follows: An embodiment of the present invention was implemented on a machine equipped with a 192 Intel(R) Xeon(R) Platinum 8468 central processing unit, an NVidia H800 graphics processor, and 1TB of memory.

[0032] (I) Construction of table dual-axis positional encoding Currently, most large-scale model structures use one-dimensional positional encoding. This invention constructs a dual-axis positional encoding for tables, which can better capture the two-dimensional relationships between table cells. The specific implementation steps are as follows: 1. Standardized preprocessing of tabular data: The input table (supporting mainstream formats such as Excel, CSV, and HTML) is converted into a structured cell sequence. Each cell of the input table corresponds to a set of text word vectors, and the set of text word vectors consists of multiple text word vectors (tokens).

[0033] Assign a unique two-dimensional location index (r, c) to each cell, representing the row index and column index respectively. Record the row index r (incrementing from 0 or 1) and column index c (incrementing from 0 or 1) of each cell in the original input table as the unique location identifier (r, c) of the cell.

[0034] 2. Row Position Code Generation: Optimized sine / cosine position coding is used to generate the row position code PE. row (r,c), the calculation formula is as follows: PE row (r,c)=sin((r / (10000 c / dm ))*(r / max(R-1,1))), where c is an even number PE row (r,c)=cos((r / (10000 (c-1) / dm ))*(r / max(R-1,1))), where c is an odd number Where dm is the hidden layer dimension (common values ​​are 512 and 768), max() represents the maximum value function, and R represents the total number of rows.

[0035] Generate a row position encoding matrix corresponding to all row indices and store it as a two-dimensional array. The optimized row position encoding method described above not only accurately captures the relative positional relationships between rows, but also has length invariance, allowing it to flexibly adapt to table data with any number of rows.

[0036] 3. Column position code generation: Using the same sine and cosine position code as the row position code, only the row index r is replaced with the column index c to generate the column position code PE. col (r,c), the calculation formula is: PE col (r,c)=sin((c / (10000 r / dm ))*(c / max(C-1,1))), where r is an even number PE col (r,c)=cos((c / (10000 (r-1) / dm ))*(c / max(C-1,1))), where r is an odd number Where C represents the total number of columns.

[0037] Generate a column position encoding matrix corresponding to all column indices and store it as a two-dimensional array. This optimized column position encoding process can effectively capture the logical relationships between columns (such as the correspondence between table headers and data columns, and the order of different attribute columns), providing key support for the model to understand the semantics of table column dimensions.

[0038] (ii) Multimode fusion of dual-axis position coding Furthermore, a flexible dual-axis position code fusion method is provided, which generates a dual-axis fused position code PE based on the aforementioned row and column position codes. final As the final cell position code, to adapt to the needs of different task scenarios, the specific solution is as follows: Learnable fusion mode: Two learnable weight parameters α (row position weight) and β (column position weight) are introduced, satisfying α + β = 1. During model training, the values ​​of α and β are adaptively adjusted to achieve dynamic weighted fusion of row and column position information. The calculation formula is as follows: PE final =αPE row (r,c)+ βPE col (r,c) This mode offers the highest flexibility, automatically optimizing the weight of location information based on specific task requirements (for example, α will automatically increase in cross-table reasoning tasks and table information extraction tasks), making it suitable for diverse and complex scenarios.

[0039] (III) The learning process is represented in a table. 1. Cell input indicates construction: The preprocessed set of text word vectors for each cell is input into a text embedding layer (such as a RoBERTa embedding layer) to generate a text semantic embedding vector X. text ; Embed the text semantic vector X text Position encoding PE after dual-axis fusion final Adding elements together, we get the final cell input representation vector X=X. text + PE final .

[0040] Specifically, for the text in each i-th cell, a text embedding vector X is generated using a pre-trained language model. text (i), and then its dual-axis position encoding PE final (i) Add them together to form the final input representation: X i =X text (i)+ PE final (i) 2. Semantic Feature Extraction: Represent the input vector X of all cells. i = Concatenate the cells in row-major order to form a sequence (i.e., first iterate through all cells in row 1, then row 2, and so on), X = [X1, X2...X... N Then, the data is input into a multi-layer semantic feature extractor, which outputs the global semantic information of the table.

[0041] The semantic feature extractor captures global associations between cells through a multi-layer self-attention mechanism to obtain global contextual semantic features, including global associations such as cross-row and column cell semantic interactions and remote dependencies between table headers and data. Then, the global contextual semantic features are non-linearly transformed by the feed-forward network, and finally outputs a global table representation vector H (with dimensions [N, dm], where N is the total number of cells in the table) containing the two-dimensional structure information of the table and global semantics.

[0042] (iv) Design of joint task loss function This invention sets up a joint task loss function that includes the losses of two sub-tasks to improve the model's comprehensive understanding and generalization ability of tabular data, as detailed below: 1. Loss L of the table-based question-and-answer task qa : This subtask loss aims to enable the model to extract accurate answers from a table based on user-provided questions. The global representation vector of the table output by the model is fused with the question embedding vector and input into a classifier to obtain the answer prediction result; cross-entropy loss is employed. This loss term ensures the model possesses core task processing capabilities, providing fundamental support for practical applications.

[0043] 2. Problem and header association loss L header : As the core information of the table, the table header directly reflects the meaning of the content of the corresponding column. Establishing a connection between the question and the table header as a new loss helps the model quickly locate the column where the answer is located in the table.

[0044] L header =-(Σ M i=1 [log(e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ))*y i ]) / M -λ*(Σ M i=1 Σ M j=1,j≠i[(log(1-P i )+log(1-P j ))*(1- y i,j )*Ⅱ(y i,j =0)]) / (M*(M-1)) P i = e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ) P j = e sim(hj,q) / τ / (Σ M j=1 e sim(hj,q) / τ ) Where M is the total number of table headers (i.e., the number of columns), hi is the global representation vector of the i-th header output by the large-scale table domain model, q is the question embedding vector, sim() is the cosine similarity function, τ is the hyperparameter coefficient, and y i For the true associated label of the i-th header (y) i =1 corresponds to the head of the answer list, y i =0 indicates that the answer list header is not included), y i,j P represents the associated label in the list header of list i and j. i Let P represent the matching probability of the i-th header. j This represents the matching probability of the j-th table header, where i and j represent the table header index, λ is the negative sample penalty weight, and Ⅱ() is the indicator function (1 if the condition in parentheses is true, 0 otherwise), Ⅱ(y i,j =0) means that 1 is taken if the head of both i and j are non-answer columns, otherwise 0 is taken; e represents the natural constant, Σ M i=1 Σ M j=1,j≠i [] indicates a pairwise combination of non-related table headers.

[0045] Joint loss function calculation: Finally, the losses of the two sub-tasks are weighted and summed according to a certain weight ratio to obtain the joint task loss function, which is given by formula L. total : L total =AL qa +BL header A+B=1 Here, A and B are the weight coefficients of the losses for the two sub-tasks, and α can be adjusted according to the task requirements of different application scenarios (e.g., in scenarios where table-based question answering tasks have high priority, the value of α can be increased). During model training, by minimizing L... total This allows for the optimization of model parameters, enabling the model to gain a deep and comprehensive understanding of tabular data.

[0046] In practice, Qwen3-8B was selected as the base model, and the LlamaFactory framework was used for supervised fine-tuning; the optimizer was AdamW, and the initial learning rate was set to 1 e^(-1 / 2). -5 With a warm-up strategy, the batch size is set to 768, and the number of training rounds is set to 2 epochs.

[0047] (v) Using the above loss function, train a large-scale model for the table domain. Finally, use the trained large-scale model for the table domain to perform prediction processing on table data and question text in real-world application scenarios to obtain: 1. Addressing the real-world requirement in table scenarios that "non-related headers are not necessarily equally unrelated," the model avoids conflating semantically similar but differently related headers, preventing incorrect answer column location due to "similar" semantic judgments. Ensures the model can accurately locate headers directly relevant to the question when faced with multi-header tables.

[0048] 2. Make full use of the semantic information of all table headers to improve the model's generalization ability on unseen table structures or question types.

[0049] Comparative Example 1:

[0050] Question: What is the content of the table in the third row and second column? Answer: 92℃ Because traditional location coding is one-dimensional while table location information is two-dimensional, using traditional location coding loses one dimension of information, making it difficult to answer these types of questions correctly.

[0051] Comparative Example 2:

[0052] Question: What was the temperature of device A02 last night? Answer: The operating temperature of equipment A02 was 88℃ last night. The table contains temperature-related information such as operating temperature and ambient temperature. If the correlation with the table header is omitted, the system may misjudge the ambient temperature column, leading to an error.

[0053] The above comparison shows that the loss associated with the table header can better distinguish similar columns in the table. In the table, "operating temperature" and "ambient temperature" are related to temperature, but operating temperature is more relevant to the question. Adding the loss associated with the table header ensures a correct answer, while not adding it leads to an error.

[0054] The above specific embodiments are used to explain and illustrate the present invention, but not to limit the present invention. Any modifications and changes made to the present invention within the spirit and scope of the claims shall fall within the protection scope of the present invention.

[0055] The above description is only a preferred embodiment of the present invention. Therefore, all equivalent changes or modifications made to the structure, features and principles described in the claims of this patent application are included in the scope of this patent application.

Claims

1. A method of table biaxial position encoding and large model table question answering of joint task loss function, characterized in that: The method comprises: Step (I) collecting table data and generating questions and answers related to the table, and performing structured and two-axis position coding processing on the table data to obtain a set of text word vectors and two-axis position coding of each cell; Step (two) fusing the dual-axis position encodings to obtain a dual-axis fused position encoding PE final ; Step (three) encode PE of the position after biaxial fusion final and the text word vector set are combined and sequentially input into the table field large model for processing to obtain a table global representation vector H; Step (IV) using the table global representation vector H to establish a special loss function with table structure characteristics for the table domain large model, so as to enhance the understanding and reasoning ability of the model to the table semantic and structure information, and finally using the trained table domain large model to predict the table data and questions in the actual application scene to obtain the table answer result.

2. The method of claim 1, wherein the method of a table two-axis position coding and a joint task loss function of a large model table question and answer comprises: Step (I) is specifically: (11) converting the input table into a structured cell sequence to obtain a set of text word vectors; (12) Adopting optimized sine-cosine position encoding to generate row position encoding PE row (r,c) and column position encoding PE col (r,c) as biaxial position encoding.

3. The method of claim 2, wherein the method is characterized in that: Step (11) is specifically: converting each cell of the table into a set of text word vectors, and the set of text word vectors is composed of multiple text word vectors, and each cell is assigned a unique two-dimensional position index (r, c), r and c represent row index and column index, respectively.

4. The method of claim 2, wherein the method is characterized in that: Step (12) is specifically: Generating row position encoding (PE) using optimized sine-cosine position encoding row (r,c), is represented as follows: PE row (r,c) = sin((r / (10000 c / dm )*(r / max(R-1,1))), c is even PE row (r,c) = cos((r / (10000 (c-1) / dm )*(r / max(R-1,1))), c is odd Wherein, dm is the hidden layer dimension, max() represents the maximum value function, and R represents the total number of rows. Generating column position encodings (PEs) using sinusoidal position encodings consistent with row position encodings col (r,c), is represented as follows: PE col (r,c) = sin((c / (10000 r / dm )*(c / max(C-1,1))), r is even PE col (r,c) = cos((c / (10000 (r-1) / dm *(c / max(C-1,1))), r is odd Wherein, C represents the total number of columns.

5. The method of claim 1, wherein the method is characterized in that: In step (I), the question and answer data are also encoded and converted into a question embedding vector and an answer embedding vector, respectively, for subsequent training processing.

6. The method of claim 1, wherein the method is characterized in that: Step (II) is specifically: According to row position encoding PE row (r,c) and column position encoding PE col (r,c) the dual axis fused position encoding PE final as the final cell position encoding: PE final = αPE row (r, c) + βPE col (r, c) Wherein, α and β represent the row position weight and the column position weight, respectively, and α + β = 1.

7. The method of claim 1, wherein the method is characterized in that: In step (III), the table domain large model comprises a text embedding layer and an encoder, which is specifically: (31) Cell input representation construction: input the text word vector set of each cell into the text embedding layer to generate a text semantic embedding vector X text ; then add the text semantic embedding vector X text and the position encoding PE final after the double-axis fusion, element-wise addition, to obtain the cell input representation vector X=X text + PE final ; (32) semantic feature extraction: concatenating all cell input representation vectors X in the order of row first and column second into a sequence and then inputting into a multi-layer semantic feature extractor to output the global semantic information of the table; The global context semantic features are obtained by capturing the global association between cells through a multi-layer self-attention mechanism Self-Attention in the semantic feature extractor; Then, the global context semantic features are nonlinearly transformed by a feed-forward neural network Feed-Forward Network, and finally the table global representation vector H containing the two-dimensional structure information and the global semantic of the table is outputted.

8. The method of claim 1, wherein the method is characterized in that: In the step (three), two task losses are established for the training of the table domain large model, a total loss is constructed by combining the two task losses, and the table domain large model after training is obtained by taking the total loss minimization as a target for training; the two task losses include a table question and answer task loss L qa , a question and table header association loss L header .

9. The method of claim 8, wherein the method is characterized in that: The table question and answer task loss L qa The table question and answer task loss L is obtained by inputting the table global representation vector output by the table field large model and the question embedding vector into a classifier to obtain an answer prediction result, and then calculating a cross-entropy loss between the answer prediction result and the true answer.

10. The method of claim 8, wherein the method is characterized in that: The table header global representation vector is extracted from the table global representation vector, and a question and table header association loss L is established by combining the question embedding vector with the table header global representation vector header , the question and table header association loss L header is calculated according to the following formula: L header =-(Σ M i=1 [log(e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ))*y i ]) / M -λ*(∑ M i=1 ∑ M j=1,j≠i [(log(1-P i )+log(1-P j ))*(1- y i,j )*Ⅱ(y i,j =0)]) / (M*(M-1)) P i = e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ) P j = e sim(hj,q) / τ / (Σ M j=1 e sim(hj,q) / τ ) where M is the total number of table headers, hi is the i-th table header global representation vector output by the table domain large model, q is the question embedding vector, sim() is the cosine similarity function, τ is the hyperparameter coefficient, y i is the true association label of the i-th table header, y i,j represents the association label of the i, j table headers, P i represents the matching probability of the i-th table header, P j represents the matching probability of the j-th table header, i and j represent the serial numbers of the table headers, λ is the negative sample penalty weight, II() is the indicator function, II(y i,j =0) represents 1 when the i, j table headers are both non-answer columns, otherwise 0; e represents the natural constant; The table header is the cell part at the beginning of the table, and the table global representation vector H of the cell where the table header is located is used as the table header global representation vector.

Citation Information

Patent Citations

  • Table text question and answer method based on hierarchical graph neural network

    CN114969279A

  • Table text numerical reasoning question and answer method based on joint modeling

    CN120448495A

  • Table structuring method, device and system and storage medium

    CN120635928A

  • Detecting object locations on spatial data items

    EP4553781A1

  • Semantic reasoning for tabular question answering

    US20220374426A1