A method for large model table question answering of table biaxial position encoding and joint task loss function
By designing a dual-axis positional encoding of tables and a 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 question answering capabilities are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- COMPUTER INNOVATION TECH RES INST OF ZHEJIANG UNIV
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-14
AI Technical Summary
Existing table processing techniques cannot effectively capture the two-dimensional structural information of tables, and the model training objective is singular, resulting in insufficient accuracy and robustness in complex scenarios.
We employ a method of dual-axis positional encoding of tables and a joint task loss function. By constructing the dual-axis positional encoding, multi-modal fusion, and training with joint loss, we enhance the model's ability to understand the semantics and structure of tables.
It improves the accuracy and robustness of the model in processing complex tabular data, enabling it to better understand the two-dimensional structure and semantic information of tables and adapt to various task scenarios.
Smart Images

Figure CN121435989B_ABST
Abstract
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:
[0008] (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.
[0009] (ii) Merge the dual-axis position codes of the cells to obtain the dual-axis merged position code PE. final ;
[0010] (iii) The position code PE after merging the two 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.
[0011] (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.
[0012] The specific steps (i) are as follows:
[0013] (11) Convert the input table into a structured cell sequence to obtain a set of text word vectors;
[0014] (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.
[0015] The specific steps (11) are as follows:
[0016] 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.
[0017] The specific steps (12) are as follows:
[0018] Optimized sine and cosine position coding is used to generate row position code PE. row (r,c) represents the following:
[0019] PE row (r,c)=sin((r / (10000 c / dm ))*(r / max(R-1,1))), where c is an even number
[0020] PE row (r,c)=cos((r / (10000 (c-1) / dm ))*(r / max(R-1,1))), where c is an odd number
[0021] 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;
[0022] 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:
[0023] PE col (r,c)=sin((c / (10000 r / dm ))*(c / max(C-1,1))), where r is an even number
[0024] PE col (r,c)=cos((c / (10000 (r-1) / dm ))*(c / max(C-1,1))), where r is an odd number
[0025] Where C represents the total number of columns.
[0026] 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.
[0027] Step (II) specifically includes:
[0028] 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:
[0029] PE final =αPE row (r,c)+ βPE col (r,c)
[0030] Where α and β represent the row position weight and column position weight, respectively, and α + β = 1.
[0031] In step (iii), the large table domain model includes a text embedding layer and an encoder, specifically:
[0032] (31) Cell input indicates construction:
[0033] 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 ;
[0034] (32) Semantic feature extraction:
[0035] 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.
[0036] 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;
[0037] 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.
[0038] In step (iv), 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 .
[0039] The table-based question-and-answer task loss L qa Cross-entropy loss is used.
[0040] 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.
[0041] 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:
[0042] L header =-(Σ M i=1 [log(e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ))*y i ]) / M
[0043] -λ*(Σ 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))
[0044] P i = e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ )
[0045] P j = e sim(hj,q) / τ / (Σ M j=1 e sim(hj,q) / τ )
[0046] 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;
[0047] The table header is the cell portion 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.
[0048] The actual associated label of the table header is the label information within the cell containing the table header.
[0049] 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.
[0050] 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).
[0051] 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;
[0052] 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").
[0053] 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.
[0054] 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.
[0055] 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.
[0056] 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.
[0057] Compared with existing methods, the present invention has the following significant advantages:
[0058] 1) Make full use of the two-dimensional structure of the table
[0059] 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.
[0060] 2) Enhance model generalization and reasoning capabilities
[0061] 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.
[0062] 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.
[0063] 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
[0064] Figure 1 This is the method logic diagram of the present invention. Detailed Implementation
[0065] The invention will be further described below with reference to specific implementations.
[0066] like Figure 1 As shown, the embodiments of the present invention and their implementation process are as follows:
[0067] 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.
[0068] (I) Construction of table dual-axis positional encoding
[0069] 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:
[0070] 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).
[0071] 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.
[0072] 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:
[0073] PE row (r,c)=sin((r / (10000 c / dm ))*(r / max(R-1,1))), where c is an even number
[0074] PE row (r,c)=cos((r / (10000 (c-1) / dm))*(r / max(R-1,1))), where c is an odd number
[0075] 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.
[0076] 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.
[0077] 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:
[0078] PE col (r,c)=sin((c / (10000 r / dm ))*(c / max(C-1,1))), where r is an even number
[0079] PE col (r,c)=cos((c / (10000 (r-1) / dm ))*(c / max(C-1,1))), where r is an odd number
[0080] Where C represents the total number of columns.
[0081] 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.
[0082] (ii) Multimode fusion of dual-axis position coding
[0083] 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:
[0084] 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:
[0085] PE final =αPE row(r,c)+ βPE col (r,c)
[0086] 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.
[0087] (III) The learning process is represented in a table.
[0088] 1. Cell input indicates construction:
[0089] 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 ;
[0090] 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 .
[0091] 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:
[0092] X i =X text (i)+ PE final (i)
[0093] 2. Semantic Feature Extraction:
[0094] 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.
[0095] 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.
[0096] (iv) Design of joint task loss function
[0097] 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:
[0098] 1. Loss L of the table-based question-and-answer task qa :
[0099] 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.
[0100] 2. Problem and header association loss L header :
[0101] 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.
[0102] L header =-(Σ M i=1 [log(e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ ))*y i ]) / M
[0103] -λ*(Σ 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))
[0104] P i = e sim(hi,q) / τ / (Σ M i=1 e sim(hi,q) / τ )
[0105] P j = e sim(hj,q) / τ / (Σ M j=1 e sim(hj,q) / τ )
[0106] 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.
[0107] 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 :
[0108] L total =AL qa +BL header
[0109] A+B=1
[0110] 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.
[0111] 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.
[0112] (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:
[0113] 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.
[0114] 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.
[0115] Comparative Example 1:
[0116]
[0117] Question: What is the content of the table in the third row and second column?
[0118] Answer: 92℃
[0119] 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.
[0120] Comparative Example 2:
[0121]
[0122] Question: What was the temperature of device A02 last night?
[0123] Answer: The operating temperature of equipment A02 was 88℃ last night.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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 for large-scale table-based question answering using dual-axis positional encoding and a joint task loss function, characterized in that: The method includes: Step (1) Collect table data and generate table-related questions and answers. Perform structured and dual-axis positional encoding on the table data to obtain the text word vector set and dual-axis positional encoding for each cell. Step (ii) fuse the dual-axis position codes to obtain the fused dual-axis position code PEfinal; Step (3) Combine the dual-axis fused positional encoding PEfinal and the text word vector set, and then input them sequentially into the large table domain model for processing to obtain the global table representation vector H; Step (iv) Utilize the global representation vector H of the table to establish a special loss function for the large table domain model with table-oriented structural characteristics, so as to enhance the model's ability to understand and reason about the semantic and structural information of the table. Finally, use the trained large table domain model to predict and process the table data and questions in the actual application scenario to obtain the table answer results. In step (iv), 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 ; The table-based question-and-answer task loss L qa The table global representation vector output by the large table domain model is fused with the question embedding vector and input into a classifier to obtain the answer prediction result. Then, the cross-entropy loss is used to calculate the difference between the answer prediction result and the true answer. 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 using the following formula: L header =-(S M i=1 [log(e sim(hi,q) / τ / (S M i=1 e sim(hi,q) / τ ))*y i ]) / M -l*(S M i=1 S 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 = and sim(hi,q) / τ / (Σ M i=1 And sim(hi,q) / τ ) P j = and sim(hj,q) / τ / (Σ M j=1 And sim(hj,q) / τ ) Where M is the total number of table headers, 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,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 Let λ represent 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, Ⅱ(y i,j =0) means that 1 is taken when both i and j are non-answer columns, otherwise 0 is taken; e represents the natural constant; The table header is the cell portion at the beginning of the table, and the global representation vector H of the cell containing the table header is used as the global representation vector of the table header.
2. The method for large-scale table-based question answering using dual-axis positional encoding and joint task loss function as described in claim 1, characterized in that: 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.
3. The method for large-scale table-based question answering using dual-axis positional encoding and joint task loss function as described in claim 2, characterized in that: The specific steps (11) are as follows: each cell of the table is converted into a set of text word vectors, the set of text word vectors consists of multiple text word vectors, and each cell is assigned a unique two-dimensional position index (r, c), where r and c represent the row index and column index, respectively.
4. The method for large-scale table-based question answering using dual-axis positional encoding and joint task loss function as described in claim 2, characterized in that: 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, 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.
5. The method for large-scale table-based question answering using dual-axis positional encoding and joint task loss function as described in claim 1, characterized in that: In step (i), both the question and answer data are encoded and converted into question embedding vectors and answer embedding vectors, respectively, for subsequent training processing.
6. The method for large-scale table-based question answering using dual-axis positional encoding and joint task loss function as described in claim 1, characterized in that: 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: INSTEAD final =αPE row (r,c)+ βPE col (r,c) Where α and β represent the row position weight and column position weight, respectively, and α + β = 1.
7. The method for large-scale table-based question answering with dual-axis positional encoding and joint task loss function as described in claim 1, characterized in that: In step (iii), the large table domain model includes a text embedding layer and an encoder, specifically: (31) Cell input representation construction: Input the set of text word vectors of each cell into the text embedding layer to generate 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 representation 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 contextual semantic features by using a multi-layer self-attention mechanism to capture global associations between cells. 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.
Citation Information
Patent Citations
Table structuring method, device and system and storage medium
CN120635928A
Method for processing cross-modal question answerning based on large model, apparatus and storage medium
US20250316269A1
Cited By
Table data recognition method, system, medium and device based on deep learning
CN122489773A