Cross-page table discrimination method based on double semantics
Through the double-semantic cross-page table discrimination method, the two-stage discrimination is performed using the table header and context prefix text model, which solves the problem of low accuracy and efficiency of cross-page table recognition in the existing technology, and improves the accuracy and efficiency of recognition. Ensure data integrity.
Patent Information
- Application Number
- CN202410983332.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-12-27
AI Technical Summary
When identifying spreadsheets, the accuracy and efficiency are low, especially complex tables and tables containing a large number of numbers and text, which can easily lead to data loss or errors, affecting the accuracy and reliability of data analysis.
Using a cross-page table discrimination method based on double semantics, two-stage two-class classification is performed through the table header discrimination model and the context prefix text discrimination model. The table header discrimination model is used to filter out whether the table header exists or not, and the semantic features are fused through the context prefix text discrimination model. and positional characteristics, establish dependencies, and improve discrimination accuracy.
It improves the accuracy and efficiency of cross-page table discrimination, simplifies the discrimination process, avoids the complexity of structured methods, enhances the recognition ability of cross-page tables, and ensures data integrity.
Smart Images

Figure CN119202813A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of text processing, and in particular to a method for distinguishing cross-page tables based on dual semantics. Background Art
[0002] During PDF parsing, identifying whether a table spans multiple pages is crucial to maintaining the coherence and integrity of the document content. Tables are a common way to organize and present data, especially in documents such as financial reports, statistical analysis, and research papers, where tables often contain key quantitative information. If tables span multiple pages, it becomes particularly important to ensure the continuity of these tables during document parsing and information extraction. First, correctly identifying tables that span multiple pages helps maintain data integrity. In automated processing and information extraction, if tables are split, data loss or errors may occur, which in turn affects the accuracy and reliability of data analysis.
[0003] To address this problem, existing methods can generally be divided into two types: those based on structural judgment and those based on global semantic judgment of tables. The structural judgment method mainly compares whether the context tables are of the same format, such as the number of columns and sub-columns in the table. This method often cannot guarantee the correctness of the judgment results when facing complex tables. The global semantic judgment method sends the context table to the semantic judgment model to semantically judge whether the table content is coherent. However, there are often a large number of numbers and texts in the table. If they are sent to the model without screening, the word segmentation characteristics of the semantic model will greatly affect the model judgment and reduce the accuracy and efficiency of the model. Due to the inherent characteristics of semantics, it is very easy to misjudge context-similar tables using only semantic judgment methods.
[0004] Therefore, how to efficiently and accurately judge the cross-page context table is still a problem that needs to be solved. Summary of the invention
[0005] In order to overcome the defects of low accuracy and efficiency in cross-page judgment of context tables in the above-mentioned prior art, the present invention proposes a cross-page table judgment method based on dual semantics.
[0006] To achieve the above object, the present invention adopts the following technical solution, a method for identifying a cross-page table based on dual semantics, comprising:
[0007] S1: Obtain the context table data to be tested;
[0008] S2: using the table header discrimination model to judge the table below to be tested, and judging whether the table below has a table header. If not, proceed to the subsequent steps; if so, judge that it is not a cross-page table.
[0009] S3: Use the context prefix text discrimination model to judge the context table to be tested to determine whether the semantics of the context table are consistent. If they are consistent, it is determined to be a cross-page table; if they are inconsistent, it is determined not to be a cross-page table.
[0010] Preferably, the training process of the header discrimination model includes:
[0011] S21: Construct the header data set T = {t1, t2, .., t k ,…,t K}, where t k Indicates the header text information of the kth sample, where K is the total number of samples in the header data set;
[0012] S22: Generate a header text sequence X of the kth sample according to the header text information of the kth sample in the header data set k ={[CLS],t k ,[SEP],[PAD],…,[PAD],…,[EOS]}, where [CLS] is the start character, [SEP] is the spacing character, [PAD] is the padding character, and [EOS] is the end character;
[0013] S23: Extract semantic features from the header text sequence to obtain the header text semantic features V T , where the semantic feature V of the header text T Classification features including semantic features of header text
[0014] S24: Obtain the discrimination probability p of the header text based on the semantic features of the header text T , the formula is as follows:
[0015]
[0016] Among them, W1 and b1 represent the weight and bias matrix of the classification module of the pre-trained header discriminant model, respectively, softmax is a normalized exponential function, which means that the elements are normalized, and SiLU is an adaptive activation function;
[0017] S25: Compare the discrimination probability of the header text with the probability threshold of the header text to obtain a discrimination result of whether the following table has a header;
[0018] For the header discrimination model, cross entropy is used as the loss function, the maximum number of iterations is set, and the header discrimination model is trained using back propagation and gradient descent methods to obtain a trained header discrimination model.
[0019]
[0020] in, represents the discriminant probability of the kth header text, and
[0021] Preferably, the training process of the context prefix text discrimination model includes:
[0022] S34: Fusing the semantic features of the table prefix text with the position features of the context table to obtain the semantic position features of the table prefix text. The semantic position features of the table prefix text include:
[0023] Semantic position feature x of the table header in the above text t =LN(W2L p )+LN(W3v t );
[0024] Semantic position feature x of the text in the table above p =LN(W4L p )+LN(W5v p );
[0025] The semantic position feature of the text in the following table x r =LN(W6L r )+LN(W7v r );
[0026] Among them, the semantic features of the table prefix text include the semantic features of the table header above v t 、Semantic features of the text in the table above v p And the semantic features of the text in the table below v r , W2, W3, W4, W5, W6 and W7 are learnable parameters, LN is the layer normalization operation, L p is the position feature of the above table, L r For the position characteristics of the table below;
[0027] S35: Concatenate the semantic position features of the context table body text to obtain the semantic position features of the concatenated table body text, and establish a dependency relationship between the semantic position features of the concatenated table body text and the semantic position features of the table header in the previous context through a cross-attention method to obtain a complete fused table feature:
[0028] Semantic position feature of the text of the concatenated table x c ={x p ;x r};
[0029] Complete fusion table features
[0030] in, It is the i-th row information of the semantic position features of the table text, W8 and W9 are learnable parameters, and SiLU is an activation function.
[0031] Preferably, in step S34, the location feature of the context table is obtained by:
[0032] For the mth sample in the context table prefix dataset, obtain the position features of the context table respectively and
[0033] in, and Respectively represent the horizontal and vertical coordinates of the upper left and lower right corners of the table above, and Respectively represent the horizontal and vertical coordinates of the upper left and lower right corners of the table below.
[0034] Preferably, after step S35, the method further includes:
[0035] S36: Based on the complete fusion table features, the attention weight of each row of information in the complete fusion table features is adjusted by model self-learning to obtain the representation vector H of the complete fusion table. The calculation formula of the representation vector H of the complete fusion table is:
[0036]
[0037] Among them, α i is the attention weight of the i-th row information of the complete fusion table features.
[0038] Preferably, the attention weight α of the i-th row information of the complete fusion table feature is i The calculation formula is:
[0039]
[0040] Among them, the exp(.) function is an exponential function with the real number e as the base.
[0041] Preferably, the training process of the context prefix text discrimination model, before step S34, further includes:
[0042] S31: Construct a context table prefix data set C = {c1, c2, ..., c m ,…,c M}, where c m is the table text information of the mth sample, c m ={t c ; p1, p2, …, p n ,…,p N ; r1, r2, … rn ,…,r N}, the table text information includes the table header information above c , the text information of the table above and the text information of the table below; p n With r n Respectively represent the nth line of text information of the previous table and the following table body text, N is the total number of rows of the previous or following table, and M is the total number of samples of the context table prefix data set;
[0043] S32: According to the table text information in the mth sample in the context table prefix data set, obtain the table prefix text sequence of the mth sample Among them, Y t The text sequence of the table header above. is the text sequence of the nth row in the table above, The text sequence for the nth row of the table below;
[0044] Y t ={[CLS],t c ,[SEP],[PAD],…[PAD],…,[EOS]};
[0045]
[0046] S33: Extract semantic features from the table prefix text sequence to obtain the semantic features of the table prefix text Among them, v t is the semantic feature of the table header above, is the semantic feature of the nth row of the text in the table above, The semantic features of the nth line of the text in the table below.
[0047] Preferably, the training process of the context prefix text discrimination model, after step S36, further includes:
[0048] S37: Obtain the discrimination probability p of the context table across pages based on the representation vector of the complete fusion table C ;
[0049] S38: The discriminant probability p of the context table across pages C The result is compared with the set probability threshold to determine whether the context table spans pages.
[0050] Preferably, the context table cross-page discrimination probability p C The calculation formula is:
[0051] p c =softmax(MLP(SiLU(W 10 H)+H))
[0052] Among them, MLP is a linear network layer, which is used to convert the dimension of the representation vector H of the complete fusion table into the dimension required for classification, W 10 represents a learnable parameter, and softmax is a normalized exponential function, which indicates a normalization operation.
[0053] Preferably, the context prefix text discrimination model is trained using back propagation and gradient descent method, and the loss function L of the context prefix text discrimination model is C for:
[0054]
[0055] in, represents the discrimination probability of the mth context table across pages, and
[0056] The advantages of the present invention are:
[0057] (1) The present invention transforms the problem of cross-page table identification into a two-stage two-classification problem of first identifying the table header of the following text and then identifying the semantics of the context table content. This avoids the process of constructing complex identification rules by structured methods, simplifies the difficulty of studying the problem, and is easy to deploy in practical applications with high efficiency.
[0058] (2) In the actual process of distinguishing, the present invention uses accurate and efficient distinction of the table header of the following text as a pre-filtering method. When the table header of the following text does not exist, the second stage of semantic distinction of the context table content is entered. When distinguishing the semantic content of the context table, the semantic features of the table prefix text are fused with the position features of the context table, and a dependency relationship is established between the semantic position features of the spliced table body text and the semantic position features of the table header of the preceding text through a cross-attention method, thereby improving the accuracy and precision of the present invention in distinguishing cross-page tables.
[0059] (3) When performing semantic discrimination on the content of a context table, the present invention utilizes the prefix data of the context table to perform inference and prediction on the entire table, thereby speeding up the calculation speed of the model.
[0060] (4) The present invention converts the complete fusion table features into the representation vector of the complete fusion table through self-learning, so as to better discriminate the model.
[0061] (5) When constructing a table sequence, the present invention adds specific sign symbols to hide the internal structure of the table in the text sequence as structured prompt information, which helps the model to make quick judgments.
[0062] (6) The present invention concatenates the table text information in the mth sample in the context table prefix data set to obtain the table prefix text sequence Y m , and use the header discrimination model and the context prefix text discrimination model to extract semantic features of the header text sequence and the table prefix text sequence respectively. By using two discrimination models, the present invention has higher discrimination accuracy for cross-page tables. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 It is a schematic diagram of the overall process of the present invention;
[0064] Figure 2 This is a schematic diagram of the training process of the header discrimination model;
[0065] Figure 3 Schematic diagram of the context prefix text discrimination model training process. DETAILED DESCRIPTION
[0066] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0067] like Figure 1-3 As shown, the present invention proposes a method for distinguishing cross-page tables based on dual semantics, comprising:
[0068] S1: Obtain the context table data to be tested;
[0069] S2: Input the first line text sequence of the table below to be tested into the trained table header discrimination model for judgment. If it is determined that the table below does not have a table header, proceed to the subsequent steps; otherwise, it is determined that it is not a cross-page table;
[0070] S3: Input the table prefix text sequence of the context table to be tested and the position feature of the context table into the trained context prefix text discrimination model to obtain a discrimination result.
[0071] The training process of the header discrimination model includes:
[0072] S21: Construct the header data set T = {t1, t2, .., t k ,…,t K}, where t k Indicates the header text information of the kth sample, where K is the total number of samples in the header data set;
[0073] S22: Generate a header text sequence X of the kth sample according to the header text information of the kth sample in the header data set k ={[CLS],t k ,[SEP],[PAD],…,[PAD],…,[EOS]}, where [CLS] is the start character, [SEP] is the spacing character, [PAD] is the padding character, and [EOS] is the end character;
[0074] S23: Extract semantic features from the header text sequence to obtain the header text semantic features V T , where the semantic feature V of the header text T Classification features including semantic features of header text
[0075] S24: Obtain the discrimination probability p of the header text based on the semantic features of the header text T , the formula is as follows:
[0076]
[0077] Among them, W1 and b1 represent the weight and bias matrix of the classification module of the pre-trained header discriminant model, respectively. Softmax is a normalized exponential function, which means that the elements are normalized. SiLU is an adaptive activation function, also known as the Swish activation function. It is an adaptive activation function introduced by Google Brain in 2017.
[0078] S25: Compare the discrimination probability of the header text with the probability threshold of the header text to obtain a discrimination result of whether there is a header in the following table.
[0079] For the header discrimination model, cross entropy is used as the loss function, the maximum number of iterations is set, and the header discrimination model is trained using back propagation and gradient descent to obtain a trained header discrimination model. The loss function formula of the header discrimination model is as follows:
[0080]
[0081] in, represents the discriminant probability of the kth header text, and
[0082] In this embodiment, the maximum number of iterations of the pre-trained header discrimination model is set to epoch_number1 = 8, and the gradient descent method uses the Adam optimization algorithm with a learning rate of 2e-5, an exponential decay rate β1 = 0.9, and β2 = 0.999. When the number of iterations reaches 8, L T When it reaches the minimum, stop training to obtain a trained header discrimination model.
[0083] The training process of the context prefix text discrimination model includes:
[0084] S31: Construct a context table prefix data set C = {c1, c2, ..., c m ,…,c M}, where c m is the table text information of the mth sample, c m ={t c ; p1, p2, …, p n ,…,p N ; r1, r2, … r n ,…,r N}, the table text information includes the table header information above c , the text information of the table above and the text information of the table below; p n With r n Respectively represent the nth line of text information of the previous table and the following table body text, N is the total number of rows of the previous or following table, and M is the total number of samples in the context table prefix data set.
[0085] S32: According to the table text information in the mth sample in the context table prefix data set, obtain the table prefix text sequence of the mth sample Among them, Y t The text sequence of the table header above. is the text sequence of the nth row in the table above, The text sequence for the nth row of the table below;
[0086] Y t ={[CLS],t c ,[SEP],[PAD],…[PAD],…,[EOS]};
[0087]
[0088] S33: Extract semantic features from the table prefix text sequence to obtain the semantic features of the table prefix text Among them, v t is the semantic feature of the table header above, is the semantic feature of the nth row of the text in the table above, The semantic features of the nth line of the text in the table below;
[0089] S34: Fusing the semantic features of the table prefix text with the position features of the context table to obtain the semantic position features of the table prefix text. The semantic position features of the table prefix text include:
[0090] Semantic position feature x of the table header in the above textt =LN(W2L p )+LN(W3v t );
[0091] Semantic position feature x of the text in the table above p =LN(W4L p )+LN(W5v p );
[0092] The semantic position feature of the text in the following table x r =LN(W6L r )+LN(W7v r );
[0093] Among them, the semantic features of the table prefix text include the semantic features of the table header above v t 、Semantic features of the text in the table above v p And the semantic features of the text in the table below v r , W2, W3, W4, W5, W6 and W7 are learnable parameters, LN is the layer normalization operation, L p is the position feature of the above table, L r For the position characteristics of the table below;
[0094] In S34, the location feature of the context table is obtained in the following manner:
[0095] For the mth sample in the context table prefix dataset, obtain the position features of the context table respectively and
[0096] in, and Respectively represent the horizontal and vertical coordinates of the upper left and lower right corners of the table above, and The horizontal and vertical coordinates represent the upper left and lower right corners of the table below. The position feature of the context table is the position information of the context table on the page, which improves the accuracy of subsequent context prefix text identification.
[0097] S35: Concatenate the semantic position features of the context table body text to obtain the semantic position features of the concatenated table body text, and establish a dependency relationship between the semantic position features of the concatenated table body text and the semantic position features of the table header in the previous text through a cross-attention method to obtain a complete fused table feature:
[0098] Semantic position feature of the text of the concatenated table x c ={x p ;x r};
[0099] Complete fusion table features
[0100] in, It is the i-th row information of the semantic position features of the text of the concatenated table, W8 and W9 are learnable parameters, and SiLU is an activation function;
[0101] S36: Based on the complete fusion table features, obtain the attention weight α of the i-th row information of the complete fusion table features i ;
[0102] Then, by using the model self-learning method, the attention weight of each row of information in the complete fusion table feature is adjusted to obtain the representation vector H of the complete fusion table;
[0103] The attention weight α of the i-th row information of the complete fusion table feature i The calculation formula is:
[0104]
[0105] Among them, the exp(.) function is an exponential function with the real number e (e≈2.71828) as the base;
[0106] The calculation formula of the representation vector H of the complete fusion table is:
[0107]
[0108] S37: Obtain the discrimination probability p of the context table across pages based on the representation vector of the complete fusion table C ; The discriminant probability p of the context table across pages C The calculation formula is:
[0109] p c =softmax(MLP(SiLU(W 10 H)+H))
[0110] Among them, MLP is a linear network layer, which is used to convert the dimension of the representation vector H of the complete fusion table into the dimension required for classification, W 10 represents a learnable parameter, and softmax is a normalized exponential function, which indicates a normalization operation.
[0111] S38: The discriminant probability p of the context table across pages C Compare with the set probability threshold to obtain the judgment result of whether the context table spans pages;
[0112] In the context prefix text discrimination model, cross entropy is used as the loss function, the maximum number of iterations is set, and the context prefix text discrimination model is trained using back propagation and gradient descent. The loss function L of the context prefix text discrimination model is C for:
[0113]
[0114] in, represents the discrimination probability of the mth context table across pages, and
[0115] In this embodiment, the HTML parsed from the PDF file is used as the data source, and the table information in the PDF file is obtained through the beautifulsoup (a Python library that can extract data from HTML or XML files) web page file parsing framework.
[0116] For complete table data, when obtaining the table header data set, this embodiment only selects the first line of text in the table as a positive sample, and randomly selects the same number of table texts in other positions as negative samples. When obtaining the context table prefix data set, first clean and filter the tables with more than 2N lines of text in the table body, and randomly split them continuously to form the text of the upper and lower tables with N lines as positive samples. Since there may be tables with very similar structural semantics in the same PDF file, tables from two different PDF files are randomly selected, and text pairs with N lines are randomly split as negative samples.
[0117] When constructing the table header dataset and the context table prefix dataset, regular expressions are used to replace numbers with decimal points and numbers with more than five digits in cells with "NUM" to save memory resources. "CELL" is added between cells as a division mark, and "ROW" is added to the end of each row of information in the context table body text as a line break mark within the table.
[0118] Of course, it is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, but also includes the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any reference numerals in the claims should not be regarded as limiting the claims involved.
[0119] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
[0120] The techniques, shapes, and structural parts not described in detail in the present invention are all well-known techniques.
Claims
1. A method for identifying cross-page tables based on dual semantics, characterized in that: include: S1: Obtain the context table data to be tested; S2: using the table header discrimination model to judge the table below to be tested, and judging whether the table below has a table header. If not, proceed to the subsequent steps; if so, judge that it is not a cross-page table. S3: Use the context prefix text discrimination model to judge the context table to be tested to determine whether the semantics of the context table are consistent. If they are consistent, it is determined to be a cross-page table; If they are inconsistent, it is determined that the table is not a cross-page table.
2. A method for identifying a cross-page table based on dual semantics as claimed in claim 1, characterized in that: The training process of the header discrimination model includes: S21: Construct the header data set T = {t1, t2, .., t k ,…,t K }, where t k Indicates the header text information of the kth sample, where K is the total number of samples in the header data set; S22: Generate a header text sequence X of the kth sample according to the header text information of the kth sample in the header data set k ={[CLS],t k ,[SEP],[PAD],…,[PAD],…,[EOS]}, where [CLS] is the start character, [SEP] is the spacing character, [PAD] is the padding character, and [EOS] is the end character; S23: Extract semantic features from the header text sequence to obtain the header text semantic features V T , where the semantic feature V of the header text T Classification features including semantic features of header text S24: Obtain the discrimination probability p of the header text based on the semantic features of the header text T , the formula is as follows: Among them, W1 and b1 represent the weight and bias matrix of the classification module of the pre-trained header discriminant model, respectively, softmax is a normalized exponential function, which means that the elements are normalized, and SiLU is an adaptive activation function; S25: Compare the discrimination probability of the header text with the probability threshold of the header text to obtain a discrimination result of whether the following table has a header; For the header discrimination model, cross entropy is used as the loss function, the maximum number of iterations is set, and the header discrimination model is trained using back propagation and gradient descent to obtain a trained header discrimination model. The loss function formula of the header discrimination model is as follows in, represents the discriminant probability of the kth header text, and 3. A method for identifying a cross-page table based on dual semantics as claimed in claim 1, characterized in that: The training process of the context prefix text discrimination model includes: S34: Fusing the semantic features of the table prefix text with the position features of the context table to obtain the semantic position features of the table prefix text. The semantic position features of the table prefix text include: Semantic position feature x of the table header in the above text t =LN(W2L p )+LN(W3v t ); Semantic position feature x of the text in the table above p =LN(W4L p )+LN(W5v p ); The semantic position feature of the text in the following table x r =LN(W6L r )+LN(W7v r ); Among them, the semantic features of the table prefix text include the semantic features of the table header above v t 、Semantic features of the text in the table above v p And the semantic features of the text in the table below v r , W2, W3, W4, W5, W6 and W7 are learnable parameters, LN is the layer normalization operation, L p is the position feature of the above table, L r For the position characteristics of the table below; S35: Concatenate the semantic position features of the context table body text to obtain the semantic position features of the concatenated table body text, and establish a dependency relationship between the semantic position features of the concatenated table body text and the semantic position features of the table header in the previous context through a cross-attention method to obtain a complete fused table feature: Semantic position feature of the text of the concatenated table x c ={x p ;x r }; Complete fusion table features in, It is the i-th row information of the semantic position features of the table text, W8 and W9 are learnable parameters, and SiLU is an activation function.
4. A method for identifying a cross-page table based on dual semantics as claimed in claim 3, characterized in that: In step S34, the location feature of the context table is obtained in the following manner: For the mth sample in the context table prefix dataset, obtain the position features of the context table respectively and in, and Respectively represent the horizontal and vertical coordinates of the upper left and lower right corners of the table above, and Respectively represent the horizontal and vertical coordinates of the upper left and lower right corners of the table below.
5. A method for identifying a cross-page table based on dual semantics as claimed in claim 3, characterized in that: After step S35, the method further includes: S36: Based on the complete fusion table features, the attention weight of each row of information in the complete fusion table features is adjusted by model self-learning to obtain the representation vector H of the complete fusion table. The calculation formula of the representation vector H of the complete fusion table is: Among them, α i is the attention weight of the i-th row information of the complete fusion table features.
6. A method for identifying a cross-page table based on dual semantics as claimed in claim 5, characterized in that: The attention weight α of the i-th row information of the complete fusion table feature i The calculation formula is: Among them, the exp(.) function is an exponential function with the real number e as the base.
7. A method for identifying a cross-page table based on dual semantics as claimed in claim 3, characterized in that: The training process of the context prefix text discrimination model, before step S34, further includes: S31: Construct a context table prefix data set C = {c1, c2, ..., c m ,…,c M }, where c m is the table text information of the mth sample, c m ={t c ; p1, p2, …, p n ,…,p N ; r1, r2, … r n ,…,r N }, the table text information includes the table header information above c , the text information of the table above and the text information of the table below; p n With r n Respectively represent the nth line of text information of the previous table and the following table body text, N is the total number of rows of the previous or following table, and M is the total number of samples of the context table prefix data set; S32: According to the table text information in the mth sample in the context table prefix data set, obtain the table prefix text sequence of the mth sample Among them, Y t The text sequence of the table header above. is the text sequence of the nth row in the table above, The text sequence for the nth row of the table below; Y t ={[CLS],t c ,[SEP],[PAD],…[PAD],…,[EOS]}; S33: Extract semantic features from the table prefix text sequence to obtain the semantic features of the table prefix text Among them, v t is the semantic feature of the table header above, is the semantic feature of the nth row of the text in the table above, The semantic features of the nth line of the text in the table below.
8. A method for identifying a cross-page table based on dual semantics as claimed in claim 5, characterized in that: The training process of the context prefix text discrimination model, after step S36, further includes: S37: Obtain the discrimination probability p of the context table across pages based on the representation vector of the complete fusion table C ; S38: The discriminant probability p of the context table across pages C The result is compared with the set probability threshold to determine whether the context table spans pages.
9. A method for identifying a cross-page table based on dual semantics as claimed in claim 8, characterized in that: The discriminant probability p of the context table across pages C The calculation formula is: p c =softmax(MLP(SiLU(W 10 H)+H)) Among them, MLP is a linear network layer, which is used to convert the dimension of the representation vector H of the complete fusion table into the dimension required for classification, W 10 represents a learnable parameter, and softmax is a normalized exponential function, which indicates a normalization operation.
10. A method for identifying a cross-page table based on dual semantics as claimed in claim 8, characterized in that: The context prefix text discrimination model is trained using back propagation and gradient descent. The loss function L of the context prefix text discrimination model is C for: in, represents the discrimination probability of the mth context table across pages, and
Citation Information
Cited By
Header column identification method based on depth semantics and context self-adaption
CN120197611A
Header column recognition method based on deep semantics and context adaptation
CN120197611B
Cross-page table analysis method and system based on visual and semantic analysis
CN121354148A
Cross-page table parsing method and system based on visual and semantic analysis
CN121354148B
