Multimodal graph contrastive learning for form document information extraction
The structure-aware sequence model with GCN and multimodal graph contrastive learning effectively addresses the challenge of extracting information from complex documents by generating contextualized embeddings and unifying self-supervised pre-training across modalities, achieving superior results in understanding and classifying text and images from complex layouts without requiring correct serialization.
Patent Information
- Application Number
- PCT/US2023/017028
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-03
AI Technical Summary
Existing natural language processing models face challenges in understanding and extracting information from complex form documents with structured layouts, such as tables and fillable regions, as they require proper serialization of text, which can be difficult and impact their ability to draw meaningful conclusions.
A structure-aware sequence model using a graph convolutional network (GCN) to generate contextualized supertoken embeddings, combined with a transformer employing sparse attention, and a centralized multimodal graph contrastive learning strategy to unify self-supervised pre-training across text, layout, and image modalities, allowing for the extraction of information without needing to infer the correct reading order.
This approach reduces the size and training requirements of models while achieving state-of-the-art performance in extracting and classifying text and information from non-standard layouts, such as forms, marketing documents, and images, by preserving local syntactic information and capturing targeted visual cues.
Smart Images

Figure US2023017028_03102024_PF_FP_ABST
Abstract
Description
MULTIMODAL GRAPH CONTRASTIVE LEARNING FOR FORM DOCUMENT INFORMATION EXTRACTIONBACKGROUND
[0001] Advances in natural language processing and sequence modeling continue to improve the ability of language models to parse and understand information gathered from different types of documents. However, to meaningfully leam from any document, the model must either know or be able to accurately infer the order of (or “serialize”) the words in the document. For a simple document consisting of only a single block of text, properly serializing the text may only require a “left-to-right, top-to bottom” approach in which each word is collected by moving from left to right across the first line, and then moving down to the next line.
[0002] For documents with more complicated forms, properly serializing the text can be more challenging, and may thus adversely impact the language model’s ability to draw conclusions and derive meaningful information from that text. Thus, form-like documents can pose unique challenges compared to article-like documents. For instance, form-like documents often have complex layouts that contain structured objects like tables, columns, and fillable regions. Certain approaches may employ multimodal learning in form document understanding. However, such approaches that extend the mask language modeling to other modalities may require careful multi-task tuning, complex reconstruction target designs, or additional pre-training data.BRIEF SUMMARY
[0003] Aspects of the technology concerns systems and methods for providing a structure-aware sequence model that can interpret a document’s text without first inferring the proper reading order of the document. In some aspects of the technology, the model uses a graph convolutional network (“GCN”) to generate contextualized “supertoken” embeddings for each token, and feeds them to a transformer that employs a sparse attention paradigm in which attention weights for at least some supertokens are modified based on differences between predicted and actual values of the order and distance between the attender and attendee supertokens. In some aspects of the technology, the transformer may use an extended transformer construction (“ETC”) with a sparse global-local attention mechanism, or another model architecture adapted to long-sequences which employs a similar sparse attention paradigm.
[0004] Through the incorporation of GCN-generated supertokens, the structure -aware sequence models discussed herein can explicitly preserve local syntactic information that may otherwise be missed in the local attention calculations (e.g., for “long-long” pairings) for a sequence that has not been properly serialized. By removing the need for the sequence model to correctly infer the reading lay out of the inputdocument, this approach may reduce both the size of the models needed, and the amount of training required, to obtain (or exceed) state-of-the-art performance.
[0005] Other aspects of the technology introduce a centralized multimodal graph contrastive learning strategy to unify self-supervised pre-training. The graph contrastive objective maximizes the agreement of multimodal representations, providing a natural interplay for all modalities without special customization. Image features can be extracted withing a bounding box that joins a pair of tokens connected by a graph edge, thereby capturing more targeted visual cues without loading a sophisticated and separately pre-trained image embedder. Thus, the technology is able to utilize a text, layout and image modality to achieve superior results.
[0006] The systems and methods disclosed herein may be used to enhance the extraction and classification of text and other information from images containing text in non-standard layouts, such as forms, marketing documents, menus, photographs or the like. The results can be applied in, e.g., multimodal question-answer situations.
[0007] According to one aspect of the technology, a processing system is provided that comprises memory configured to store one or more input documents and one or more processors operatively coupled to the memory. Each input document includes text and imagery. The processors are configured to: generate, for a given input document according to a graph convolutional network, graph construction to obtain a baseline graph that is associated with layout, image and text modalities. The baseline graph having a set of tokens, in which each given token of the set has a node comprising a vector based on content and location of a given string of text within the given input document, and one or more edges. Each edge links the node corresponding to the given token to a neighboring node corresponding to another token of the set of tokens. The processors are further configured to perform image feature extraction on the given input document according to the baseline graph and to perform stochastic graph corruption on the baseline graph according to the image feature extraction to generate a pair of corrupted graphs. A first one of the corrupted graphs is generated by discarding first selected percentages of edgelevel features and node-level features of the baseline graph. A second one of the corrupted graphs is generated by discarding second selected percentages of the edge-level features and node-level features of the baseline graph. The node-level features are associated with the text modality of the baseline graph and the edge-level features are associated with the layout and image modalities of the baseline graph. The processors are further configured to perform graph contrastive learning between features of the pair of corrupted graphs to generate a trained self-supervised multimodal model.
[0008] In one example, the image feature extraction is configured to capture similar patterns within one token and / or dissimilar patterns or separations between tokens. In another example, the image featureextraction applies a convolutional neural network to extract dense image features on the whole document image. In a further example, the image feature extraction includes region of interest (ROI) pooling to pool the features within a bounding box that joins a pair of tokens connected by a graph convolutional network edge. Here, the processing system may be further configured to apply a convolutional neural network on the pooled features for refinement.
[0009] Alternatively or additionally to any of the above, the processing system is further configured to concatenate extracted image features with layout features at edges of the baseline graph Alternatively or additionally to any of the above, the second selected percentages are different than the first selected percentages. Alternatively or additionally to any of the above, the stochastic graph corruption may be performed by adopting imbalanced drop-rates of modalities between the pair of corrupted graphs. Alternatively or additionally to any of the above, discarding the first and second selected percentages of edge-level features may include both edge dropping and edge feature dropping. Alternatively or additionally to any of the above, the second selected percentages may be complementary to the first selected percentages. The first and second selected percentages may be between 20% and 80%. The first selected percentages may include different percentages for each of the layout, image and text modalities thereof, and the second selected percentages may include different percentages for each of the layout, image and text modalities thereof.
[0010] Alternatively or additionally to any of the above, the graph convolution network may include a graph convolution network encoder and an extended transformer construction decoder. In this case, the stochastic graph corruption may be performed on the graph convolution network encoder. The stochastic graph corruption may not performed on the extended transformer construction decoder.
[0011] Alternatively or additionally to any of the above, the processing system may be further configured to apply the trained self-supervised multimodal model to a form document to identify one or more features of the form document. Alternatively or additionally to any of the above, the trained selfsupervised multimodal model may be configured to identify which pair of nodes across all pairs of corrupted nodes came from a same node.
[0012] According to another aspect of the technology, a computer-implemented method is provided comprising: generating, by one or more processors of a computing system for a given input document according to a graph convolutional network, graph construction to obtain a baseline graph that is associated with layout, image and text modalities, the baseline graph having a set of tokens, each given token of the set having a node comprising a vector based on content and location of a given string of text within the given input document, and one or more edges, each edge linking the node corresponding to the given token to a neighboring node corresponding to another token of the set of tokens; performing, by theone or more processors, image feature extraction on the given input document according to the baseline graph; performing, by the one or more processors, stochastic graph corruption on the baseline graph according to the image feature extraction to generate a pair of corrupted graphs, a first one of the corrupted graphs being generated by discarding first selected percentages of edge-level features and nodelevel features of the baseline graph, a second one of the corrupted graphs being generated by discarding second selected percentages of the edge-level features and node-level features of the baseline graph, wherein the node-level features are associated with the text modality of the baseline graph and the edgelevel features are associated with the layout and image modalities of the baseline graph; and performing, by the one or more processors, graph contrastive learning between features of the pair of corrupted graphs to generate a trained self-supervised multimodal model.
[0013] The image feature extraction may be configured to capture similar patterns within one token and / or dissimilar patterns or separations between tokens. The image feature extraction may apply a convolutional neural network to extract dense image features on the whole document image. The image feature extraction may include region of interest (ROI) pooling to pool the features within a bounding box that joins a pair of tokens connected by a graph convolutional network edge.
[0014] Alternatively or additionally to any of the above, the method may further comprise concatenating extracted image features with layout features at edges of the baseline graph. Alternatively or additionally to any of the above, the graph convolution network may include a graph convolution network encoder and an extended transformer construction decoder. Here, the stochastic graph corruption may be performed on the graph convolution network encoder and the stochastic graph corruption is not performed on the extended transformer construction decoder.BRIEF DESCRIPTION OF THE DRAWINGS
[0015] FIG. 1 is a functional diagram of an example system in accordance with aspects of the disclosure.
[0016] FIG. 2 is a functional diagram of an example system in accordance with aspects of the disclosure.
[0017] FIG. 3 is a flow diagram illustrating how a structure-aware sequence model may process an exemplary document, in accordance with aspects of the disclosure.
[0018] FIG. 4 is a flow diagram illustrating how a set of bounding boxes may be processed in order to generate an exemplary beta-skeleton graph, in accordance with aspects of the disclosure.
[0019] FIG. 5 depicts an exemplary method for generating a beta-skeleton graph from a set of bounding boxes, in accordance with aspects of the disclosure.
[0020] FIG. 6 depicts an exemplary portion of a document, a corresponding exemplary beta-skeleton graph, an exemplary serialized version of the text of the document, and an illustration of how localattention scores may be adjusted based on differences betw een predicted and actual values of the order and distance between the attender and attendee tokens, in accordance with aspects of the disclosure.
[0021] FIG. 7 is a flow diagram illustrating how an attention head of a transformer may employ a “Rich Attention” paradigm, in accordance with aspects of the disclosure.
[0022] Figs. 8A-D illustrate an example for creating a graph of a sample region from a form in accordance with aspects of the technology.
[0023] FIGS. 9A-D illustrate different modalities in a multimodal approach according to aspects of the technology.
[0024] FIGS. 10A-B illustrate examples of image feature extraction in accordance with aspects of the technology.
[0025] FIGS. 11A-B illustrate aspects of graph contrastive learning in accordance with aspects of the technology.
[0026] FIG. 12 illustrates a table of experimental results according to aspects of the technology.
[0027] FIG. 13 illustrates a plot of model size versus entity extraction Fl score in accordance with aspects of the technology.
[0028] FIG. 14 illustrates a table of experimental results according to aspects of the technology.
[0029] FIGS. 15A-D illustrate experimental results for testing with the same drop-rate across modalities (FIGS. 15A-B) and fortesting using different drop-rates across modalities (FIGS. 15C-D).
[0030] FIGS. 16A-B illustrate visualizations in accordance with aspects of tire technology.
[0031] FIG. 17 is a flow diagram in accordance with aspects of the technology.DETAILED DESCRIPTION
[0032] The present technology will now be described with respect to the following exemplary systems and methods.
[0033] Different aspects of the technology provide a multimodal approach to evaluate items with complex layouts, such as form -type documents having tables, columns and / or fillable regions. Tire multimodal approach encompasses text, layout and image-related information associated with items to be evaluated. The following includes a general introduction and a discussion of text and layout modalities, and then explains how an image modality can be added to complement such modalities. This includes a centralized multimodal graph contrastive learning (“GCL”) strategy that is employed to unify selfsupervised pre-training for all modalities in one loss.Example Systems
[0034] FIG. 1 shows a high-level system diagram 100 of an exemplary processing system 102 for performing the methods described herein. The processing system 102 may include one or moreprocessors 104 and memory 106 storing instructions 108 and data 110. The instructions 108 and data 110 may include any of the structure-aware sequence models described herein. In addition, the data 110 may store documents and / or training examples to be used in training a sequence model, and / or documents to be used during inference. Processing system 102 may be resident on a single computing device. For example, processing system 102 may be a server, personal computer, or mobile device, and a sequence model may thus be local to that single computing device. Similarly, processing system 102 may be resident on a cloud computing system or other distributed system. In such a case, a sequence model may be distributed across two or more different physical computing devices. For example, in some aspects of the technology, where a sequence model includes both a GCN and a transformer (as discussed further below), the processing system may comprise a first computing device storing the GCN and a second computing device storing the transformer. Moreover, multimodal graph contrastive learning may be performed across one or more processing devices of the processing system.
[0035] FIG. 2 shows a high-level system diagram 200 in which the exemplary processing system 102 just described is shown in communication with various websites and / or remote storage systems over one or more networks 208, including websites 210 and 218 and remote storage system 226. In this example, websites 210 and 218 each include one or more servers 212a-212n and 220a-220n, respectively. Each of the servers 212a-212n and 220a-220n may have one or more processors (e.g., 214 and 222), and associated memory (e.g., 216 and 224) storing instructions and data, including the content of one or more webpages. Likewise, although not shown, remote storage system 226 may also include one or more processors and memory storing instructions and data. In some aspects of the technology, the processing system 102 may be configured to retrieve documents and / or training data from one or more of website 210, website 218, and / or remote storage system 226 to be provided to a sequence model for training or inference.
[0036] The processing systems described herein may be implemented on any type of computing device(s), such as any type of general computing device, server, or set thereof, and may further include other components typically present in general purpose computing devices or servers. Likewise, the memory of such processing systems may be of any non-transitory type capable of storing information accessible by the processor(s) of the processing systems. For instance, the memory may include a non- transitory medium such as a hard-drive, memory card, optical disk, solid-state, tape memory, or the like. Computing devices suitable for the roles described herein may include different combinations of the foregoing, whereby different portions of the instructions and data are stored on different types of media.
[0037] In all cases, the computing devices described herein may further include any other components normally used in connection with a computing device such as a user interface subsystem. The userinterface subsystem may include one or more user inputs (e.g., a mouse, keyboard, touch screen and / or microphone) and one or more electronic displays (e.g., a monitor having a screen or any other electrical device that is operable to display information). Output devices besides an electronic display, such as speakers, lights, and vibrating, pulsing, or haptic elements, may also be included in the computing devices described herein.
[0038] The one or more processors included in each computing device may be any conventional processors, such as commercially available central processing units (“CPUs”), graphics processing units (“GPUs”), tensor processing units (“TPUs”), etc. Alternatively, the one or more processors may be a dedicated device such as an ASIC or other hardware-based processor. Each processor may have multiple cores that are able to operate in parallel. The processor(s), memory, and other elements of a single computing device may be stored within a single physical housing, or may be distributed between two or more housings. Similarly, the memory of a computing device may include a hard drive or other storage media located in a housing different from that of the processor(s), such as in an external database or networked storage device. Accordingly, references to a processor or computing device will be understood to include references to a collection of processors or computing devices or memories that may or may not operate in parallel, as well as one or more servers of a load-balanced server farm or cloud-based system.
[0039] The computing devices described herein may store instructions capable of being executed directly (such as machine code) or indirectly (such as scripts) by the processor(s). The computing devices may also store data, which may be retrieved, stored, or modified by one or more processors in accordance with the instructions. Instructions may be stored as computing device code on a computing device-readable medium. In that regard, the terms “instructions” and “programs” may be used interchangeably herein. Instructions may also be stored in object code format for direct processing by the processor(s), or in any other computing device language including scripts or collections of independent source code modules that are interpreted on demand or compiled in advance. By way of example, the programming language may be C#, C++, JAVA or another computer programming language. Similarly, any components of the instructions or programs may be implemented in a computer scripting language, such as JavaScript, PHP, ASP, or any other computer scripting language. Furthermore, any one of these components may be implemented using a combination of computer programming languages and computer scripting languages.Structural Encoding Beyond Sequential Modeling in Form Document Information Extraction Example Methods
[0040] FIG. 3 shows a flow diagram 300 illustrating how a structure-aware sequence model may process an exemplary document 302, in accordance with aspects of the disclosure. In that regard, in the exampleof FIG. 3, it is assumed that the processing system (e.g., processing system 102) receives a document 302 depicting a smart phone with various features highlighted in text. Specifically, the words “Cameras,” “16MP,” and “8MP” are listed on or near the top left comer of the smartphone; the word “OLED” is listed within the smartphone’s screen; the word “IP68” is shown in a box overlapping the right side of the smartphone’s case; the word “5G” is shown in a star overlapping the left side of the smartphone’s case; and the words “USB” and “3.5mm” are listed around the bottom right comer of the smartphone’s case.
[0041] In this example, the processing system processes document 302 (e.g., an image of a document comprising pixel data) to obtain a listing of the text on the page, and the location of each word, as shown in layout 304. The information represented in layout 304 may be harvested from document 302 in any suitable way. For example, in some aspects of the technology, the processing system may perform optical character recognition (“OCR”) on document 302 to identify each word, and its respective position on the page.
[0042] In exemplary layout 304, the words of document 302 have each been replaced with numbered tokens (to through t?). In addition, the size and position of each word has been represented with corresponding bounding boxes. Thus, the word “Cameras” is represented in layout 304 as token to and bounding box 306a; “16MP” is represented with token ti and bounding box 306b; “8MP” is represented with token t2 and bounding box 306c; “OLED” is represented with token L and bounding box 306d; “IP68” is represented with token tj and bounding box 306e; “5G” is represented with token ts and bounding box 306f; “USB” is represented with token to and bounding box 306g; and “3.5mm” is represented with token t? and bounding box 306h.
[0043] In this example, it has been assumed for the sake of illustration that each of the words of document 302 will translate to a single token. However, in some aspects of the technology, the processing system may be configured to use a wordpiece tokenization paradigm (e.g, the multilingual wordpiece tokenization approach employed by BERT-type transformers), in which certain words may be tokenized into one or more constituent wordpieces. In such a case, one or more words of document 302 may be broken into multiple wordpiece tokens (e.g., “Cameras” may be tokenized into “Camera” and “##s”, “16MP” may be tokenized into “16” and “##MP”, etc.), each of which would have its own smaller bounding box in layout 304.
[0044] Likewise, while the exemplary layout 304 shows each token having a bounding box, any other suitable approach may be used to record the size and position of each token. For example, in some aspects of the technology, each token’s size and position on the page may be represented using the coordinates of a single point (e.g., top left comer of the token on the page) combined with the token’s height and width. Likewise, in some aspects of the technology, the size and position of the token may bean estimate. For example, if “16MP” is tokenized into “16” and “##MP” (“##” being a suffix token identifier), the processing system may be configured to take the overall width of the word “16MP” and simply divide that overall width evenly for each character such that the width of the individual bounding boxes for “16” and “MP” are both half of the overall width of “16MP.” This estimation approach may be used even in cases where the lettering in document 302 is not proportional, and thus the bounding box for “16” would in fact overlap the letter “M” on the page.
[0045] The processing system processes layout 304 to generate a beta-skeleton graph 308 in which each token (to-t?) of the layout 304 is represented as a node (310a-310h), and each node is connected to one or more nearby nodes with one or more edges (e.g., 312). An exemplary method for generating the nodes and edges of a beta-skeleton graph is set forth below with respect to FIGS. 4 and 5, but any other suitable method for generating a beta-skeleton graph may also be employed.
[0046] Each node 310a-310h of beta-skeleton graph 308 contains a vector (vo-v?) corresponding to the information listed for its corresponding token in layout 304. These beta-skeleton vectors vo-v? may be based on any suitable combination of the information contained in layout 304 for their respective tokens. For example, the beta-skeleton vector for each token may generated by concatenating a text embedding based on the text of the token, with a spatial embedding based on where the token is located in document 302 (e.g., as represented by the bounding box of layout 304). Thus, assuming that a full-word tokenization paradigm is used such that the text of token to is “Cameras,” the beta-skeleton vector vo corresponding to token to may be generated by concatenating a text embedding based on the word “Cameras” and a spatial embedding based on the bounding box for token to in layout 304. Here as well, the spatial embedding may be based on any suitable representation of the token’s location, including the coordinates of two comers of the bounding box (e.g., top-left and bottom-right comers), the coordinates of one comer combined with the height and width of the bounding box, etc. Likewise, any suitable learned or static embedding function may be used to generate the text embeddings and spatial embeddings on which the beta-skeleton vectors are based.
[0047] In addition, in some aspects of the technology, the beta-skeleton graph 308 may further include an edge embedding for each of the edges extending from the given node in the beta-skeleton graph. In such a case, edge embeddings may be based on any suitable representation of the spatial relationship between the given node and each neighboring node to which it is linked.
[0048] Thus, in some aspects of the technology, for a given node A and a neighboring node B, an edge embedding may comprise the distance between one or more common points in the bounding boxes of the tokens to which nodes A and B correspond (e.g., the distance between the centers of each bounding box, between the top-right comers of each bounding box, between the top-left comers of each bounding box.between the bottom right-comers of each bounding box, between the bottom-left comers of each bounding box, etc.). Likewise, in some aspects, an edge embedding for an edge between node A and B may comprise the shortest total distance, shortest vertical distance, and / or the shortest horizontal distance between the bounding boxes of the tokens to which nodes A and B correspond. Likewise, in some aspects, an edge embedding for an edge between node A and B may comprise the coordinates (or coordinates of a given point and associated height and width) of a larger bounding box that encloses the individual bounding boxes of the tokens to which nodes A and B correspond. Likewise, in some aspects, an edge embedding for an edge between node A and B may comprise the aspect ratio of a larger bounding box that would enclose the individual bounding boxes of the tokens to which nodes A and B correspond. Further, in some aspects of the technology, an edge embedding for an edge between node A and B may comprise any combination or subcombination of any of the options just described.
[0049] Once beta-skeleton graph 308 has been generated, the processing system will feed the betaskeleton graph 308 to a graph convolutional network, GCN 314, to generate a set of supertokens 316 corresponding to each node. In some aspects of the technology, the processing system may be configured to provide GCN 314 with both the beta-skeleton graph 308 and layout 304 (or information based thereon representing the tokens in layout 304 and / or their corresponding position on the page), and GCN 314 may be configured to generate the set of supertokens 316 based thereon.
[0050] The supertoken corresponding to a given node will be based on the given node’s beta-skeleton vector, as well as the beta-skeleton vectors of each node to which it is connected in beta-skeleton graph 308. In addition, in some aspects of the technology, the supertoken corresponding to a given node may further be based on the edge embeddings between the given node and each of these neighboring nodes. Thus, for example, since node 310a is connected to nodes 310b and 310c, the supertoken STi corresponding to node 310a will be based on beta-skeleton vector vo, as well as the beta-skeleton vectors vi and V2 of its neighboring nodes. In addition, in some aspects of the technology, the supertoken STi corresponding to node 310a may further be based on the edge embeddings for the edges between nodes 310a and 310c, and between nodes 310a and 310b.
[0051] GCN 314 may be configured to generate the supertoken for a given node based on any suitable way of combining the beta-skeleton vectors for the given node and its neighboring nodes. For example, in some aspects of the technology, the supertoken for a given node may be generated by concatenating the beta-skeleton vectors for the given node and its neighboring nodes, and then by further processing the resulting concatenated vector using a multilayer perceptron (“MLP”). Likewise, in some aspects of the technology, the GCN 314 may be configured to further process the concatenated vector using a learned embedding function or another type of feed-forward neural network.
[0052] The set of supertokens 316 will be serialized prior to being supplied to transformer 318, and the processing system may be configured to do this using any suitable serialization approach. For example, as shown in FIG. 3, the set of supertokens 316 has been serialized using a left-to-right, top-to-bottom approach based on where each corresponding token is found on layout 304. Likewise, in some aspects of the technology, the set of supertokens may be serialized using a reading order approach. Thus, if the text of document 302 were written in a language where the reading order is right-to-left, top-to-bottom (e.g., as may be true for documents written in Hebrew, Arabic, etc.), the GCN may be configured to serialize the set of supertokens 316 using a right-to-left, top-to-bottom approach based on where each corresponding token is found on layout 304. Likewise, if the text of document 302 were written in a language where reading order is top-to-bottom, right-to-left (e.g., as may be true for documents written in Chinese, Japanese, etc.), the GCN may be configured to serialize the set of supertokens 316 using a top- to-bottom, right-to-left approach based on where each corresponding token is found on layout 304.
[0053] The processing system will next process the serialized set of supertokens 316 using a transformer 318. In this example, it is assumed that transformer 318 is configured to employ a sparse attention paradigm, although aspects of the present technology may also be applied to models with transformers that employ traditional (non-sparse) attention paradigms. Thus, for example, in some aspects of the technology, transformer 318 may use an extended transformer construction (“ETC”) with a sparse global- local attention mechanism, or another model architecture adapted to long-sequences which similarly employs a sparse attention paradigm (e.g., BigBird).
[0054] In addition, it is also assumed in this example that transformer 318 is configured to base local attention scores (e.g., for “long-long” pairings in ETC and BigBird) for a given pair of attender and attendee supertokens at least in part on the difference between predicted and actual values of the order and distance between the attender and attendee supertokens (e.g., using a “Rich Attention” paradigm, as described below with respect to FIG. 7). An exemplary method for modifying local attention scores in this way is explained in more detail below with respect to FIG. 7. However, any other suitable manner of using the order and distance between attender and attendee supertokens to influence local attention scores may be employed by transformer 318. Likewise, in some aspects of the technology , supertokens may be used to improve transformers that are not otherwise configured to modify local attention scores based on the order and distance between attender and attendee supertokens.
[0055] In the example of FIG. 3, transformer 318 is configured to output a set of entity “BIOES” (Begin, Inside, Outside, End, Single) logits 320. Each of these entity BIOES logits Lo-L- represents the model’s predictions regarding how likely the corresponding token of layout 304 is to be: (1) the beginning token of a text segment in a recognized entity class; (2) an inside token of a text segment in a recognized entityclass; (3) an end token of a text segment in a recognized entity class; (4) a singleton token in a recognized entity class; or (5) an “outside” token that it is not within any recognized entity class. This approach marks the span of entities in token sequences prior to application of the Viterbi algorithm.
[0056] In particular, the processing system may process the set of entity BIOES logits 320 to determine a final prediction of the most likely BIOES type and entity class for the entire set of tokens harvested from layout 304. In the example of FIG. 3, the processing system is configured to make this determination, e.g., based on a Viterbi algorithm 322 configured to find the “Viterbi path” representing the optimal combination of BIOES types and entity classes that has the highest overall probability. However, any other suitable dynamic processing algorithm may also be used in this regard.
[0057] In FIG. 3, the Viterbi algorithm 322’s final predictions are represented as 324a-324h. Specifically, in this example: prediction 324a indicates that token to corresponding to the text “Cameras” has been predicted to be a beginning token in Entity Class 2; prediction 324b indicates that token ti corresponding to the text “16MP” has been predicted to be an inside token in Entity Class 2; prediction 324c indicates that token t2 corresponding to the text “8MP” has been predicted to be an end token in Entity Class 2; prediction 324d indicates that token t3 corresponding to the text “OLED” has been predicted to be an outside token not belonging to any recognized entity class; prediction 324e indicates that token t4 corresponding to the text “IP68” has been predicted to be an outside token not belonging to any recognized entity class; prediction 324f indicates that token ts corresponding to the text “5G” has been predicted to be a singleton token in Entity Class 5; prediction 324g indicates that token tg corresponding to the text “USB” has been predicted to be a singleton token in Entity Class 9; and prediction 324h indicates that token t? corresponding to the text “3.5mm” has been predicted to be a singleton token in Entity Class 9.
[0058] FIGS. 4 and 5 set forth a flow diagram 400 and exemplary method 500 showing how a set of bounding boxes A-D may be processed in order to generate an exemplary beta-skeleton graph.
[0059] In that regard, in step 502 of FIG. 5, the processing system (e.g., processing system 102) identifies a set of peripheral points at a preset spacing along the periphery of each bounding box, and a set of internal points along a longitudinal midline of each bounding box. FIG. 4 provides an illustrative example of how this might appear. In that regard, in block 402 of FIG. 4, the periphery of bounding box A is identified with reference numeral 404, one of the identified peripheral points of bounding box A is identified with reference numeral 406, and one of the internal points of bounding box A is identified with reference numeral 408.
[0060] In step 504 of FIG. 5, the processing system generates a Delaunay triangulation graph based on the set of the points identified in step 502. Although FIG. 4 does not show this intermediate step, as willbe understood, a Delaunay triangulation graph based on block 402 of FIG. 4 would result in the points of bounding boxes A-D being interconnected such that no point will fall within the circumcircle of any triangle of the triangulation graph. There are many known approaches for generating Delaunay triangulations from a set of points, and the processing system may use any such approach.
[0061] In step 506 of FIG. 5, the processing system identifies all “inside points” that are inside the periphery of at least one of the bounding boxes. This will include not only the internal points that were originally identified in step 502, but also any peripheral points of one bounding box that may be inside the periphery of another bounding box by virtue of those two bounding boxes overlapping. For example, looking at block 402 of FIG. 4, point 410 will initially be identified in step 502 as being a peripheral point of bounding box B. However, point 410 will later be identified in step 506 as being an “inside point” by virtue of the fact that it falls within the periphery of bounding box A. All such inside points are shown in a light gray in block 402 (as well as in blocks 412 and 416).
[0062] The processing system may be configured to identify these “inside points” in any suitable way. For example, in some aspects of the technology, the processing system may be configured to traverse each “edge” (link) of the Delaunay triangulation graph that happens to start with a peripheral point of a given bounding box and extends inside of the given bounding box, as the end points of any such edges will by definition be points within one of the bounding boxes.
[0063] In step 508 of FIG. 5, the processing system identifies a set of every edge of the Delaunay triangulation graph for which: (1) the edge’s vertices vl and v2 are not “inside points”; and (2) the circle with vlv2 as its diameter does not cover any other point. Block 412 of FIG. 4 provides an illustrative example of how this might appear, with edges 414 and 416 representing two of the 16 edges that would be identified according to step 508. As can be seen, there are no edges in block 412 between bounding boxes B and C, or between bounding boxes A and D, as every' possible connection between the points of those bounding boxes would end up creating circles which overlap at least one other point.
[0064] Here as well, the processing system may be configured to identify these edges in any suitable way. For example, based on the fact that the point closest to vlv2 will always be a neighbor of either vl or v2 (based on the properties of Delaunay triangulation graphs), the processing system may be configured to determine whether a circle with diameter vlv2 will cover any points by simply checking whether the neighbors of vl and v2 will fall within the circle with vlv2 as its diameter.
[0065] In step 510 of FIG. 5, for every pair of intersecting bounding boxes, the processing system adds an artificial edge of length 0 to the set of edges identified in step 508. In the example of FIG. 4, such an edge would be identified between intersecting bounding boxes A and B. However, since the edge isartificial (in that it doesn’t actually correspond to an edge of the Delaunay triangulation graph), it has not been visually represented in block 412.
[0066] Although step 510 follows step 508 in exemplary method 500, it will be understood that the order of these processes may also be reversed. Thus, in some aspects of the technology, the processing system may first initialize the set of edges by adding 0-length edges for all intersecting bounding boxes, and then augment that set of edges with those identified from the beta-skeleton graph as discussed above with respect to step 508.
[0067] In step 512 of FIG. 5, the processing system identifies the shortest edge between each pair of bounding boxes from within the set of edges identified in steps 508 and 510. Block 418 of FIG. 4 provides an illustrative example of how this might appear, with edge 420a being the shortest edge between bounding boxes A and C, edge 420b being the shortest edge between bounding boxes B and D, and edge 420c being the shortest edge between bounding boxes C and D. In addition, although block 412 shows an edge 416 between bounding boxes A and B, the edge with the shortest distance between these boxes will be the artificial edge of length 0 that was identified in step 510. Although this artificial edge is not visually represented in block 418, it is represented in the resulting beta-skeleton graph shown in block 422.
[0068] In step 514 of FIG. 5, the processing system generates a beta-skeleton graph comprising a node for each bounding box, and each of the edges identified in step 512. Block 422 of FIG. 4 provides an illustrative example of how this might appear, showing an exemplary beta-skeleton graph in which bounding box A is represented with node 424a, bounding box B is represented with node 424b, bounding box C is represented with node 424c, and bounding box D is represented with node 424d. In addition, nodes 424a and 424c are connected with edge 420a (as also shown in block 418), nodes 424c and 424d are connected with edge 420c (as also shown in block 418), nodes 424d and 424b are connected with edge 420b (as also shown in block 418), and nodes 424a and 424b are connected with edge 426. Further, in the exemplary beta-skeleton graph of block 422, a length for each edge of tire beta-skeleton graph is shown next to each edge. Thus, as can be seen, edge 420a has a length of 1, edge 420b has a length of 2.5, edge 420c has a length of 1.1, and edge 426 has a length of 0 (since it is an artificial edge identified based on the overlapping of bounding boxes A and B). Although these edge lengths are shown pictorially for purposes of illustration, in practice they may simply be encoded into the data structure representing the beta-skeleton graph, for example as part of edge embeddings.
[0069] FIG. 6 depicts an exemplary portion of a document, a corresponding exemplary beta-skeleton graph, an exemplary serialized version of the text of the document, and an illustration of how localattention scores may be adjusted based on differences betw een predicted and actual values of the order and distance between the attender and attendee tokens, in accordance with aspects of the disclosure.
[0070] In that regard, box 602 depicts a portion of original text as it would appear in a given exemplary document, and box 604 depicts an exemplary beta-skeleton graph overlaying that original text. This betaskeleton graph may be generated as described above with respect to FIGS. 3-5.
[0071] Box 616 depicts a serialized version of the text of box 602. In this example, the original text has been serialized using a simple left-to-right, top-to-bottom approach. In this way, box 616 helps to illustrate some of the issues that can arise from imperfect serialization. For example, the serialization approach shown in box 616 results in the column headings “TAR,” “NIC,” “MOIST,” and “MENT” immediately preceding the first word of the second line (“KOOL”), despite the column headings being very far from “KOOL” in the original text shown in box 602. Likewise, the column headings are all at least five words removed from the values “9.1,” “.88,” “14.0,” and “.474,” despite those values being listed directly beneath each of the column headings in the original text shown in box 602. Similarly, this serialization approach results in “tip-” being immediately followed by the values “9.1,” “.88,” “14.0,” and “.474,” despite there being a substantial gap between them in the original text shown in box 602. This further results in the hyphenated partial word “tip-” being five words removed from its intended suffix (“ping”), despite “ping” being closer to “tip-” than are values “9.1,” “.88,” “14.0,” and “.474” in the original text shown in box 602.
[0072] Box 618 illustrates how these types of serializing issues can present challenges for a transformer that employs a sparse global-local attention paradigm. In addition, box 618 also illustrates how these issues may be mitigated by basing local attention scores (e.g., for “long-long” pairings in ETC and BigBird) at least in part on the difference between predicted and actual values of the order and distance between the attender and attendee tokens (e.g., using a “Rich Attention” paradigm, as described below with respect to FIG. 7).
[0073] In that regard, window 620a represents an exemplary three-word local attention radius around an attender token for the word “white.” As can be seen, this local attention radius will result in the transformer generating local attention weights between the token for “white” and the tokens for “KOOL,” “Lights,” KS,” “tip-,” “9.1,” and “.88.” Thus, this three-word local attention radius will prevent the transformer from assessing attention between “white” and the tokens for “ping” and “masked,” even though those words are within three words of “white” according to the proper reading order of the original document (as shown in box 602). Likewise, this local attention paradigm will result in the transformer assessing attention between “white” and the tokens for “9.1” and “.88” even though the word“white” is farther away from “9 1” and “8.8” in the original document than it is from “ping” and “masked” in the original document.
[0074] Windows 620b-620d illustrate how attention scores for the tokens within window 620a may be modified using “Rich Attention” or a similar order- and distance-based adjustment paradigm. In that regard, the transformer may be configured to generate predictions for each pair of attender and attendee tokens which represent the “ideal” order that those tokens would be in relative to one another, and the “ideal” distance those tokens would be from one another, if it is assumed that the attender and attendee tokens do indeed relate to each other in some way. In FIG. 7, these predictions are made by learned parametric functions 708 and 712, but the transformer may generate “ideal” order and distance predictions in any suitable way (e.g., blocks 720 and 724 of FIG. 7). The transformer may then compare the actual order of the attender and attendee token (e.g., block 718 of FIG. 7) to the predicted “ideal” order to generate a first error value (e.g., block 730 of FIG. 7), and may compare the actual distance between the attender and attendee token (e.g., block 722 of FIG. 7) to the predicted “ideal” distance to generate a second error value (e.g., block 732 of FIG. 7). These error values may then be used to modify an initial pre-SoftMax attention score that the transformer generates between the attender and attendee token based on atypical query-key approach.
[0075] In some aspects of the technology, and as shown and described below with respect to FIG. 7, the transformer may use the error values to penalize the attention scores of those token pairs that have an actual order and / or distance that is different than their “ideal” order and / or distance, thus tending to decrease unwarranted attention between tokens that are in fact out of order and / or spatially distant from one another in the original document. However, in some aspects of the technology, the transformer may instead (or in addition) be configured to amplify the attention scores of those token pairs that have an actual order and / or distance that is close to their “ideal” order and / or distance, thus tending to increase warranted attention between tokens that are in fact close and / or logically ordered in the original document.
[0076] Returning now to the example shown in box 618 of FIG. 6, it has been assumed that the ideal order and / or distance between the token for “white” and the token for “9.1” will be different than the actual order and distance between “white” and “9.1” in the original document, and thus that the attention score between “white” and “9.1” will be reduced based on these differences. For example, this may result from the transformer predicting that the “ideal” distance between “white” and “9.1” (if they were related) would be much closer than how those words are actually spaced in the original document, and thus that the attention score should be reduced to some degree based on this difference. Likewise, this may result from the transformer predicting that the “ideal” order between “white” and “9.1” would be for “9.1” toprecede “white” rather than follow it (as is the case in the text of the original document), and thus that the attention score should be reduced to some other degree based on this difference.
[0077] Similarly, it has been assumed that the model’s predictions will result in reductions of the attention scores between “white” and “.88,” and between “white” and “KOOL,” but by different amounts. These varying amounts of attention score reductions are visually represented in FIG. 6 by boxes 620b, 620c, and 620d having different levels of shading.
[0078] In contrast, because the token for the word “KS” is both related to and spatially close to the token for “white” in the original text, it has been assumed that there will be little or no difference between how these tokens are actually ordered and spaced in the original document and the model’s learned prediction of the “ideal” order and spacing. As such, in this example, it is assumed that there will be little or no change made to the attention score that the transformer would otherwise generate between “white” and “KS.” For the same reason, it has been assumed that there will be little or no changes to the attention scores that the transformer would otherwise generate between “white” and “Lights” and between “white and “tip-.”
[0079] Thus, although the detrimental impact of imperfect serializing may be amplified where a sparse global-local attention paradigm is employed, the potential for the model to reach false conclusions based on improperly serialized tokens may be effectively and efficiently managed by adjusting local attention scores based on differences between predicted and actual values of the order and distance between the attender and attendee tokens, as illustrated in box 618.
[0080] In addition, because the transformers of the present technology may be configured to accept supertokens as their initial input, spatial and semantic information regarding a given token’s neighbors will automatically be weighed in the first layer of the transformer’s attention mechanism even where imperfect serializing and / or the size of the local attention radius would prevent attention from being directly assessed between a given token and one or more of its neighboring tokens from the beta-skeleton graph. Thus, for example, although the local attention radius illustrated with box 620a will prevent the transformer from directly assessing attention between the token for “white” and the token for “ping,” the transformer will end up implicitly assessing attention between “white” and “ping” because the betaskeleton vector for “ping” will propagate into the supertoken for “KOOL” through edge 606. Likewise, although attention will not be directly assessed between the token for “white” and the token for “masked,” the transformer will end up implicitly assessing attention between “white” and “masked” because the beta-skeleton vector for “masked” will propagate into the supertokens for “KOOL,” “Lights,” and “KS” through edges 608, 610, and 612, respectively.
[0081] Although the examples of FIGS. 3 and 7 both involve a transformer that is configured to both take supertokens as input, and to adjust local attention scores based on the order and distance between attender and attendee supertokens (as discussed above and below), these features may also be used separately. In that regard, although a combined approach as shown in FIGS. 3 and 7 may provide the biggest improvements over sequence models based on transformers with standard global-local sparse attention paradigms, significant benefits may be possible from using only supertokens, or only the attention-adjustment paradigms discussed herein.
[0082] FIG. 7 shows a flow diagram 700 illustrating how an attention head of a transformer may employ a “Rich Attention” paradigm, in accordance with aspects of the disclosure. As used herein, the term “Rich Attention” is not meant to identify a paradigm that is an alternative to sparse attention, nor are “Rich Attention” and sparse attention mutually exclusive. Rather, the term “rich” in “Rich Attention” is simply meant to indicate that the attention score between a given attender and attendee token will be influenced or “enriched” based on how closely the actual order and distance between those supertokens matches a predicted “ideal” order and distance for those supertokens. In this way, “Rich Attention” can be used to enrich any type of attention score, including local attention scores calculated according to a sparse global-local attention paradigm (e.g., as used in ETC and BigBird transformers), as well as attention scores calculated according to standard attention paradigms (e.g., as used in BERT transformers).
[0083] In the example of FIG. 7, the input to the attention head are two vectors h, (box 702) and h, (box 704). In the first layer of the transformer, vectors h and h7will be the supertokens for two nodes i and j of a beta-skeleton graph generated from an input document, as discussed above with respect to FIGS. 3-5. For each successive layer, vectors h, and h will be based on outputs of the previous layer. For clarity, the elements of flow diagram 700 will each be described below using the assumption that processing is taking place in the first layer of the transformer, and thus that vectors h, and h7are the supertokens for nodes i and j. Further, in all cases, it will be assumed that vector h, is the attender and vector h7is the attendee.
[0084] In the example of FIG. 7, the transformer is configured to adjust attention scores based on how closely the actual order and distance between those supertokens matches a predicted “ideal” order and distance for those supertokens. To do this, the transformer will generate four values: (1) an actual order value Oy representing an actual order between tokens i and j (box 718); (2) an “ideal” order value pi}representing the model’s prediction of what order tokens i and j should be in if that they are related to one another (box 720); (3) an actual distance value di}representing an actual distance between tokens i and j (box 722); and (4) an “ideal” distance value ^i7representing the model’s prediction of what the distance should be between tokens i and j if they are related to one another (box 724). As can be seen from thearrows of extending from h, and h, in flow diagram 700, each of these values will be calculated based at least in part on h, and h7. The individual details of functions 706, 708, 710, and 712 will be discussed further below.
[0085] In that regard, in the example of FIG. 7, the actual order value oy (box 718) is based on the indices i and j of vectors h, and h7Specifically, as shown in box 706, the transformer will compare i to j, and will assign a value of 1 if i is greater than j, and will otherwise assign a value of 0. Any suitable manner of indexing h, and h7may be used in this regard. For example, indices i and j may be the coordinates of bounding boxes surrounding tokens i and j, coordinates of the center points of the bounding boxes surrounding tokens I and / , coordinates of a common comer of the bounding boxes surrounding tokens i and j, etc. Likewise, any suitable manner of ordering h, and h;may be used. Thus, in some aspects of the technology, the actual order value Oy may represent the order of tokens i and j along a single axis or path (e.g., along the x-axis of the document, along the y-axis of the document, along a straight or curved line corresponding to the text direction in the relevant portion of the document, etc ). Likewise, in some aspects of the technology, the actual order value oy may represent the order of tokens i and j along two axes (e.g., o„ may be a vector with values corresponding to how i and j are ordered in the x-axis, and in the y-axis).
[0086] In the example of FIG. 7, the ideal order value py (box 720) is generated based on vectors h, and h, using a learned parametric function 708. Any suitable parametric function may be used in this regard. For example, in some aspects of the technology, the transformer may use a sigmoid classifier trained to predict the probability of the ordering of tokens, such as shown in Equation 1 below:Pij = Sigmoid affine °)([hj; hy]) (1)
[0087] In Equation 1, affine(o)(x) represents W(0)x + b(0)where W(o)is a weight matrix of free parameters, and b(0)is a bias vector composed of free parameters. The free parameters of W(o)and b(0)may be randomly initialized and then updated as the sequence model is trained. In that regard, the sigmoid classifier may be trained to minimize cross-entropy loss, or may be trained using any other suitable loss function.
[0088] The actual distance value d (box 722) is also based on the indices i and j of vectors h, and h7Specifically, as shown in box 710, the transformer will find the absolute value of i minus j. As mentioned above, any suitable manner of indexing and comparing h, and h7may be used in this regard. Thus, in some aspects of the technology, the actual distance value dy may be based on distance measured along a single axis or path (e.g., along the x-axis of the document, along the y-axis of the document, along a straight or curved line corresponding to the text direction in tire relevant portion of the document, etc ). Likewise, in some aspects of the technology, the actual distance value d may be based on distancesmeasured along two axes (e.g., dy may be a vector with values corresponding to how far token i is from token j along both the x-axis and the y-axis, or may be a value representing the absolute straight-line distance between token I and token j).
[0089] In the example of FIG. 7, the ideal distance value p (box 724) is generated based on vectors h, and h7using another learned parametric function 712. Here as well, any suitable parametric function may be used in this regard. For example, in some aspects of the technology, the transformer may use an affine transformation, such as shown in Equation 2 below:Hu = affined)([hi; hy]) (2)
[0090] In Equation 2, affinew(x) represents W(d)x + b(d)where W(d)is a weight matrix of free parameters, and b(d)is a bias vector composed of free parameters. Like W(o)and b(0), the free parameters of W<d)and b(d)may also be randomly initialized and then updated as the sequence model is trained. In that regard, the affine transformation may be trained to minimize an L2 loss, or may be trained using any other suitable loss function.
[0091] As shown in box 730, the actual order value oy (box 718) and ideal order value pI}(box 720) will be used to generate a negative error value s(o>. In some aspects of the technology, negative error value s(o>may be calculated using a negative sigmoid cross entropy loss, such as shown in Equation 3 below.
[0092] However, negative error value s(o>may be calculated using any negative log-likelihood function or other suitable equation that is likewise based on a comparison of, or difference between, the actual order value oy and the ideal order value py .
[0093] Likewise, as shown in box 732, the actual distance value dy (box 722) and ideal distance value py (box 724) will be used to generate a negative error value s(d). In some aspects of the technology, negative error value s(d>may be calculated using a scaled negative L2 loss, such as shown in Equation 4 below. s(d)=t2(inz
[0094] In Equation 4, the variable t represents a free parameter that will be randomly initialized and updated as the sequence model is trained. However, negative error value s(d>may be calculated using any negative log-likelihood function or other suitable equation which is based on a comparison of, or difference between, the actual distance value dy and ideal distance value pl}. Likewise, in some aspects of the technology, instead of being a constant, t may be a variable value. For example, in some aspects, t may be the output of another affine transformation that takes vectors h, and h, as input.
[0095] Although the example of FIG. 7 assumes that the actual order value oy(box 718), ideal order value py (box 720), actual distance value dy (box 722), and ideal distance value p (box 724) will all begenerated based directly on vectors h, and h7, they may also be indirectly based on vectors h, and h7. For example, each of these values may instead be generated using the reduced-rank query' and key vectors q, (box 726) and k7(box 728). In such an arrangement, vectors h and h7would be initially provided to parametric functions 714 and 716 to generate the query and key vectors q, and k7, and then q, and k7would be fed to functions 706, 708, 710, and 712 in order to generate the actual order value o,7, ideal order value pij, actual distance value < , and ideal distance value ,u,7.
[0096] Regardless of the approach used for calculating the actual order value o,7, ideal order value py, actual distance value dy, and ideal distance value py, vectors h, and h7will be provided to the learned parametric functions 714 and 716 to generate query and key vectors q, (box 726) and k, (box 728). These learned parametric functions 714 and 716 will both be separate affine transformations, each with their own weight matrix and bias vector. As discussed above, each such weight matrix and bias vector may be randomly initialized and then updated as the sequence model is trained. The resulting the query and key vectors q, and k7, will then be subjected to matrix multiplication (function 734) to generate an initial pre- SoftMax attention score. Specifically, as shown in FIG. 7, the transformer will calculate a dot product of the transpose of query vector q, and the key vector k;. The resulting initial pre-SoftMax attention score will be added to the negative error values 730 and 732 to generate an adjusted pre-SoftMax attention score, as shown in the circle labeled with reference numeral 736. That adjusted pre-SoftMax attention score will then be provided to SoftMax Function 738.
[0097] Tire remaining steps of flow diagram 700 are consistent with traditional attention processing. In that regard, vector h7is provided to a learned parametric function 740 to generate a value vector V, (box 742). The post-SoftMax attention score produced by SoftMax Function 738 is then multiplied by the value vector V7as shown in box 744, resulting in an updated vector h, as shown in box 746. As discussed above, this updated vector h, may then be used in successive layers of the transformer consistent with standard transformer architecture. Finally, the outputs of the last layer of the transformer will be used to generate tire BIOES logits described above with respect to FIG. 3.
[0098] The structure-aware sequence models of the present technology may be trained in any suitable way. In that regard, in some aspects of the technology, a structure-aware sequence model may be pretrained using one more sets of masked-language modeling tasks, and / or next-sentence prediction tasks, and may be fine-tuned using one or more annotated sets of training examples (e.g., the public FUNSD and / or CORD datasets). Likewise, in some cases, pretraining may not be deemed necessary, and the structure-aware sequence model may be trained from scratch using only annotated sets of training examples.Summarizing the text-centric approach
[0099] The above-described approach simplifies the task of document entity extraction by framing it as fundamentally text-centric, and then seeks to solve the problems that arise from this. Serialized forms can be very long, so the system uses the transformer architecture with a local attention window (ETC) as the backbone to work around the quadratic memory cost of attention. This component of the system effectively captures the text modality.
[0100] OCR serialization can also distort strong cues of semantic relatedness. For instance, a word that is just above another word may be related to it, but if there are many tokens to the right of the upper word or to the left of the lower word, they will intervene between the two after serialization, and the model may be unable to take advantage of the heuristic that nearby tokens tend to be related. The above approach adapts the attention mechanism to model spatial relationships between tokens using Rich Attention, which is a mathematically sound way of conditioning attention on low-level spatial features without resorting to quantizing the document into regions associated with distinct embeddings in a lookup table. This allows the system to build powerful representations from the layout modality for tokens that fall within the local attention window.
[0101] While Rich Attention maximizes the potential of local attention, there remains an issue of what to do when there are so many interveners between two related tokens that they do not fall within the local attention window and cannot attend to each other at all. In order to address this issue, GCN contextualization occurs before serializing the text to send to the (ETC) transformer component. The graph for the GCN locates up to AT potentially related neighbors for each token before convolving to build up the token representations that are fed to the transformer after OCR serialization.
[0102] Figs. 8A-D illustrate an example of how the above-described approach can create a graph of a sample region from a form. The sample region of the input document is presented in Fig. 8A. Fig. 8B shows the result of OCR plus graph construction. Then at Fig. 8C five nodes and five edges are constructed according to Vo - V4. From them, the graph representation of the document is constructed as shown in Fig. 8D. In this example, nodes are labeled and the graph structure is shown abstracted away from its content.
[0103] Unlike with Rich Attention, which directly learns concepts like “above”, “below”, and infinitely many degrees of “nearness”, the graph at this stage does not consider spatial relationships beyond “is a neighbor” and “is not a neighbor”. This allows the network to build a weaker but more complete picture of the layout modality than Rich Attention, which is constrained by local attention.
[0104] Thus, the main concepts discussed above are complementary, strategically trading off representational power and computational efficiency in order to allow the system to construct useful representations while simplifying the problem to be fundamentally textual rather than visual. For theabove approach, such a system can be pretrained end-to-end on large-scale unlabeled form documents with a masked language modeling (MLM) objective.Multimodal Graph Contrastive Learning
[0105] The above-described approach can be enhanced by adding an image modality in addition to the text and layout modalities. This is because image features from documents contain information absent from the text or the layout, such as fonts, colors, sizes of OCR words, separating lines or other symbols, etc. by way of example, business titles usually contain more vivid colors with stronger font designs, while line items tend to be smaller and monotone. However, document images are often large in their original format, ranging from hundreds to thousands in height and width. But at the same time, document images typically contain lots of empty white areas in the background without much information. Therefore, how to carefully design an image feature extractor is beneficially for how to be parameter and sample efficient during training.
[0106] According to one aspect of the technology, a centralized multimodal GCL strategy is utilized to unify self-supervised pre-training for all modalities in one loss. The graph contrastive objective maximizes the agreement of multimodal representations. Image features can be extracted from within a bounding box that joins a pair of tokens connected by a graph edge, capturing more targeted visual cues associated with intra- and inter-entity information without loading a sophisticated and pre-trained image embedded. These enhancements enable the graph convolutions to produce better super-tokens. As will be shown below, this enhanced approach establishes new state-of-the-art perfonnance on various benchmarks with a compact model size.
[0107] A convolutional neural network (CNN or ConvNet) may be run by the system to extract dense image features on the whole document image, and then use region of interest (ROI) pooling to pool the features within a bounding box that joins a pair of tokens connected by a GCN edge. The ROI pooled features may then be subject to another ConvNet for refinement. Then, after the image features are extracted, they can be injected into tire neural network through concatenation with the existing layout features at edges of the GCN. When a second ConvNet is performed, the extracted features may be directly injected into the edge features of a GCN.
[0108] Figs. 9A-D illustrate how the different modalities are utilized in this approach. Figs. 9A-B illustrate a concatenation of layout and image edge-level features. In particular, Fig. 9A presents geometric features by token spatial relationship, and Fig. 9B presents image features from token union boxes. As shown in Fig. 9C, eoi and eo2 edges between nodes vo-vi and V0-V2, respectively. Fig. 9D illustrates textual node-level features (“Abe”, “Lincoln” and “Sender”), which may be obtained using a BERT-type tokenizer.
[0109] Form document images often contain OCR words that are relatively small individually and are densely distributed in text blocks. They may also contain a large portion of the background region without any text. Therefore, prior approaches that incorporate image modality by extracting features from either the whole image as one vector, non-overlapping image patches as extra input tokens to transformers, or token bounding boxes that are added to the text features for all tokens may suffer from various deficiencies. These can include (i) only generating global visual representations with large noisy background regions without targeted entity representations, (ii) being overly sensitive to the patch size and chopping OCR words or long entities into different patches, and (ii) only seeing regions within each token’s bounding box but lacking context between or outside of tokens.
[0110] In contrast, implementation of the edge-level image feature representation discussed herein can precisely model the relationship between two nearby, potentially related “neighbor” tokens and the surrounding region, while ignoring all irrelevant or distracting regions.[OHl] For instance, in the examples of Figs. 10A and 10B, image features are extracted from bounding boxes 1002, 1004 that join pairs of tokens connected by edges to capture (a) similar patterns within an entity, or (b) dissimilar patterns or separating lines between entities. This demonstrates that the targeted ROI image feature pooling through the union bounding box can capture any similar patterns (e.g., font, color and / or size) within an entity (Fig. 10A, e.g., for “Abe” and “Lincoln”) or dissimilar patters or separating lines between entities (Fig. 10B, e.g., for “Abe” and “Sender”).
[0112] According to one aspect of the technology, the graph representation of a document can be utilized to learn multimodal embeddings with a contrastive loss. For instance, the system may first perform stochastic graph cormption to sample, e.g., two corrupted graphs from the original input graph of each training instance. This step generates node embeddings based on partial contexts. Then a contrastive objective can be applied by maximizing agreement between tokens at node-level. In particular, the model is asked to identify which pair(s) of nodes across all pairs of nodes, which are within the same graph and across graphs, came from tire same original node. A standard normalized temperature-scaled cross entropy loss formulation can be used, such as with temperature 0.1. Examples of such formulations may be found, e.g., in “A simple framework for contrastive learning of visual representations” by Chen et al., 2020; in “Unsupervised feature learning via non-parametric instance discrimination” by Wu et al., 2018; in “Representation learning with contrastive predictive coding” by van den Oord et al., 2018; and in “Improved deep metric learning with multi -class n-pair loss objective” by Kihyuk Sohn, 2016, each of which is incorporated herein by reference.
[0113] To build a centralized contrastive loss that unifies the interactions between multiple input modalities, the system corrupts the original graph at both graph topology level and graph feature level.Topology corruption includes edge dropping, e.g., by randomly removing edges in the original graph. Feature corruption includes applying dropping to all three modalities: dropping layout and image features from edges, and dropping text features from nodes. According to one scenario, the system may only corrupt the graph in the GCN encoder while keeping the ETC encoder intact to leverage the semantically meaningftd graph representation of the document during graph contrastive learning.
[0114] To further diversify the contexts in two corrupted graphs and reduce a possibility of training the model to over-rely on certain modalities, the system may employ an inductive graph feature dropping mechanism by adopting imbalanced drop-rates of modalities between the two corrupted graphs, which may be complementary to one another. In particular, for a given modality the system may discard p percent of the features in the first corrupted graph and discard 1 - p percent of the features in the second corrupted graph.
[0115] Fig. 11A illustrates an example 1100 of the multimodal graph contrastive learning process, in which two corrupted graphs are sampled from an input graph by corruption of graph topologies (edges) and attributes (multimodal features). As shown on the left side of the figure, original connected graph 1102 with nodes vo to V4 has associated layout, image and text modalities, with the layout and image having edge-level aspects and the text having node-level aspects. Stochastic graph corruption is performed, which involves discarding different percentages of the edge-level and node-level features, as shown at 1104a and 1104b, for the two corrupted graphs 1106a and 1106b. For corruptions in 1104a and 1104b, the shading in the layout, image and text boxes indicates a different discarding percentage (a different amount of edge dropping, edge feature dropping, and node feature dropping). By way of example only, the percentage p may be on the order of 0.5 to 0.9, such as at least 0.6 or no more than 0.85.
[0116] Fig. 11B illustrates an example of the graph contrastive learning associated with the stochastic graph corruption. As shown, at 1108 there is a positive pair of the same node from different corrupted graphs, at 1110 there is a negative pair of different nodes from the same corrupted graph (here, graph 1106a), and at 1112 there is a negative pair of different nodes from different corrupted graphs. The system can thus be trained to identify which pair of nodes across all pairs of corrupted nodes (including within the same graph) came from the same node.
[0117] Such an approach to regularization allows the model to learn rich, complex representations that take full advantage of the model’s capacity without becoming overly dependent on specific feature interactions.
[0118] The described graph contrastive objective may be used with other corruption mechanisms, allowing interactions between multiple input modalities in one single loss architecture. The architecturemay be extended to include more modalities without requiring crafting of specialized loss. These other modalities may include sound, video, and / or metadata from different file formats. Feature masking may be applied as the corruption mechanisms in these situations. Other corruption mechanisms can include feature replacement with random noises instead of zero masking.System Testing and Evaluation
[0119] The following section discusses testing and evaluation of the above-described approach. A number of different datasets were employed. The datasets include: FUNSD, CORD, SROIE, and Payment. Each is described briefly below, and the referenced articles discussing them are each incorporated herein by reference.
[0120] FUNSD contains a collection of research, marketing and advertising forms that vary extensively in their structure and appearance. The dataset used had 199 annotated forms with 9,707 entities and 31,485 word-level annotations for 4 entity types: header, question, answer, and other. The official 75-25 split for the training and test sets was used. Details about FUNSD may be found in “Funsd: A dataset for form understanding in noisy scanned documents” by Jaume et al., 2019.
[0121] CORD contains over 11,000 Indonesian receipts from shops and restaurants. The annotations are provided in 30 fine-grained semantic entities such as store name, quantity of menu, tax, amount, discount price, etc. The official 800-100-100 split was used for training, validation and test sets. Details about CORD may be found in “Cord: A consolidated receipt dataset for post-ocr parsing” by Park et al., 2019.
[0122] SROIE, from tire ICDAR 2019 Challenge on Scanned Receipts OCR and key Information Extraction, offers 1,000 whole scanned receipt images and annotations. 626 samples are for training and 347 samples are for testing. The task was to extract four predefined entities: company, date, address, and total. Details about CORD may be found in “Icdar2019 competition on scanned receipt ocr and information extraction” by Huang et al., 2019.
[0123] For Payment, the large-scale payment data was used that is described in “Representation learning for information extraction from form-like documents” by Majumder et al., 2020. Uris includes approximately 10,000 documents and 7 semantic entity labels from human annotators. The evaluation protocol and dataset splits discussed in the Majumder article were employed.
[0124] According to an experimental setup, the general structural encoding architecture described above was employed with a modification to incorporate multiple modalities for graph contrastive learning. The backbone model included a 6-layer GCN encoder to generate structure-aware super-tokens, followed by a 12-layer ETC transformer decoder equipped with Rich Attention for document entity extraction. The number of hidden units was set to 768 for both GCN and ETC. The number of attention heads was set to1 in GCN and 12 in ETC. The maximum sequence length was set to 1027. Other hyper-parameters that can be used include specific weight decay and regularization weights.
[0125] The image embedder architecture used in testing was a 3 -layer ConvNet with filter sizes {32, 64, 128} and kernel size 3 throughout. Stride 2 was used in the middle layer and stride 1 used elsewhere. The input document images were resized to 512x512 with aspect ratio fixed and zero padding for the background region. After extracting the dense features of the whole input image, feature ROI pooling was performed within the bounding box that joins a pair of tokens connected by a GCN edge. The height and width of the pooled region were set to 3 and 16, respectively. The pooled features were then processed by another 3-layer ConvNet with filter size {64, 32, 16} and kernel size 3 throughout. Stride 2 was used in the first 2 layers horizontally and stride 1 was used everywhere else. To consume image modality in the backbone model, the system concatenated the pooled image features with the existing layout features at edge level of GCN, as shown in Figs. 9A-D. Here, kernel denotes the CNN filter size, and stride denotes the interval betw een each CNN operation on 2D images.
[0126] In an experimental setup, the model was pre-trained using two unsupervised objectives, MLM and the multimodal GCL described above. Example approaches for MLM are discussed in “cloze procedure: a new tool for measuring readability” by Wilson L. Taylor (1953), and in “BERT: Pre-training of deep bidirectional transformers for language understanding” by Devlin et al. (2019), the entire disclosures of which are incorporated herein by reference. Different from BERT, MLM has access to layout and image modalities during pre-training. Nevertheless, the layout and image features were constructed at edge level instead of at node level, supplementing the text features for better underlying representation learning without directly leaking the trivial information.
[0127] Graph contrastive learning supports effective interactions between all three modalities in a contrastive fashion. For each graph representation of a document, the system may generate two corrupted views by edge dropping, edge feature dropping, and node feature dropping, with example dropping rates in tire testing scenarios of {0.3, 0.8, 0.8} respectively, with tire weight matrices in both GCN and ETC shared across the two views. Note that the dropping rates may be different, e.g., in respective ranges of 0.1-0.4, 0.5-0.9, and 0.5-0.9.
[0128] The large-scale IIT-CDIP document collection was used for pre-training, as described in “Docformer: End-to-end transformer for document understanding” by Appalaraju et al. (2021), in “Layoutlm: Pretraining of text and layout for document image understanding” by Xu et al. (2020), in “Layoutlmv2: Multi-modal pre-training for visually-rich document understanding” by Xu et al. (2021), and in “Building a test collection for complex document information processing” by Lewis et al. (2006), the entire disclosures of which are incorporated herein by reference. 11T-CD1P contains 11 milliondocument images. The models were trained from scratch using Adam optimizer with batch size of 512. The learning rate was set to 0.0002 with a warm-up proportion of 0.01. It was found that GCL generally converged faster than MLM, and therefore the loss weightings were set to 1 and 0.5 for MLM and GCL, respectively. The testing did not separately pre-train or load a pre-trained checkpoint for the image embedder. In fact, it was found that using sophisticated image embedders or pre-training with natural images did not improve the final downstream entity extraction Fl scores, and in some instances that approach could actually degrade performance. It is noted that classification, detection and segmentation for conventional vision tasks may not be optimal for form document understanding.
[0129] For testing, the models were fine-tined for the downstream entity extraction tasks using Adam optimizer with batch size 8. The learning rate was set to 0.0001 without warmups.
[0130] Table 1 in Fig. 12 lists benchmark results based on the same evaluation protocol, comparing the multimodal GCL approach described herein against other known approaches, including against the general structural encoding approach also described herein. This table presents entity-level precision (P), recall (R), and Fl score comparisons on the four standard benchmarks discussed above. T / L / I denote text / layout / image modality. As shown in Table 1, the multimodal GCL approach presented herein establishes new state-of-the-art results on all four datasets. Multimodal GCL significantly outperforms DocFormer (see “Docformer: End-to-end transformer for document understanding” by Appalaraju et al., 2021) and LayoutLMv3 (see “Layoutlmv3: Pre-training for document ai with unified text and image masking” by Huang et al., 2022) while using a 38% and 55% sized model, respectively. Note that LayoutLMv3 and StructuralLM (see “StructuralLM: Structural pre-training for form understanding” by Li et al., 2021) use segment-level layout positions that incorporate ground truth entity bounding boxes, which is less practical for real-world applications. Nevertheless, the results are reported under the same protocol in column Fit. Results for LayoutLMv3 are shown without ground-truth entity segments for comparisons.
[0131] Fig. 13 illustrates a plot of model size versus entity extraction Fl score for tire multimodal GCL and general structural encoding versus other approaches that are directly comparable. As can be seen, multimodal GCL significantly outperforms other approaches in both Fl score and parameter efficiency. From Table 1 of Fig. 12, it can be seen that using all three modalities (text + layout + image) generally outperforms using two modalities (text + layout), and using two modalities (text + layout) outperforms using one modality (text) only across different approaches.
[0132] Ablation studies were performed over the effect of image modality, graph contrastive learning, and decoupled graph corruption. The arrangement for these studies included a 4-layer 1 -attention-headGCN encoder followed by a 4-layer 8-attention-head ETC transformer decoder with 512 hidden units. The model was pretrained on the IM IIT-CDIP subset.
[0133] Table 2 in Fig. 14 lists results for the general structural encoding approach discussed herein, with variations. The results in the first row are for the baseline unmodified approach. The results in the second row included additional tokens constructed from image patches. Here, the patches had a 32x32 image patch size, resulting in an additional 256 image tokens to the model. The results in the third row included the image feature extracted from edges of a graph to incorporate the multimodal approach discussed herein. In all three examples, the networks were pretrained with MLM only to showcase the impact of input with image modality.
[0134] The results indicate that the second approach with the additional tokens constructed from image patches provided slight Fl score improvement over the baseline approach, but required 32% additional parameters. The multimodal approach in the bottom row achieved a significant Fl boost with less than 1% additional parameters over the baseline approach. It was also found that the performance of more advanced image embedders (via the additional image tokens added in the second row) was inferior to the 3-layer ConvNet used in the multimodal approach of the bottom row.
[0135] The graph corruption process discussed above (see, e.g., Fig. 11A) employs corruption of the original graph at both topology and feature levels. Considering the corruption happens in multiple places: edges, edge features, and node features, a naive graph corruption implementation could be to use the same drop-rate value everywhere. Figs. 15A-B illustrate results of downstream entity extraction Fl scores on FUNSD and CORD datasets by varying the dropping rate value across modalities during the graph contrastive pre-traming. Here, the dropping rate is shared across all places. The results show that multimodal graph contrastive learning in these scenarios works across a wide range of dropping rates. It demonstrates the significant benefit of multimodal corruption at both topology level and feature level. For instance, it brings up to 0.66% and 0.64% Fl boost on FUNSD and CORD, respectively, when the model is pretrained on MLM plus graph contrastive learning instead of MLM only. The GCL approach is also stable to perturbation of different drop rates. It can be seen in these examples that less or no performance improvement was experienced when extreme drop rates were employed. For example, dropping 10% edges and features or dropping 90% edges and features performed slightly worse than the MLM-only approach. This can be understood because dropping too little or too much information may provide either no node context changes or too few remaining node contexts in different corruption graphs for effective contrastive learning.
[0136] Another test scenario investigated whether decoupling the drop-rate in different places of graph corruption would leam better representations during pre-training and bring further improvements to thedownstream entity extraction tasks. Different drop rates were selected for all four different places: edge, layout and image features at edge level, and text features at node level. At feature layout (layout, image, text), when one of the corrupted graphs selected a dropping rate p for a certain feature, the other corrupted graph used the complement of the selected dropping rate 1 - p for the same feature as discussed above. This inductive multimodal contrastive design creates stochastically imbalanced information access to the features between two corrupted views. It provides more diverse context at node level in different views and makes the optimization of the contrastive objective harder, which could generate more semantically meaningful representations between the three modalities.
[0137] Figs. 15C-D show results for downstream entity extraction Fl scores on FUNSD and CORD datasets, respectively, using different drop-rates across modalities. The testing involved pre-training with three different edge dropping rates and three different feature dropping rates. It is observed that decoupling the dropping rate at various levels further boosts the performance on both datasets. It brings another 0.34% and 0.07% Fl boost on FUNSD and CORD, respectively, when decoupling dropping rates are used over the non-decoupled ones. Nonlinear interactions were observed between different dropping rates at edge level and feature level. The best performing feature dropping rate may be sub-optimal when a different edge dropping rate is applied, which may be understood since different edge dropping rates could drastically change the graph topology and thus the node embeddings. Nevertheless, lower edge dropping rates, e.g., rates on the order of about 0.3, such as 0.25-0.35, may perform better than higher edge dropping rates.
[0138] Additionally, the local-to-local attention scores of a CORD example for a model pre-trained with MLM only and MLM + GCL but before fine-tuning are illustrated in Fig. 16A. This visualization was generated according to “A multiscale visualization of attention in the transformer model” by Jesse Vig (2019), the entire disclosure of which is incorporated herein by reference. Here, it is observed that with GCL the model can identify more meaningful token clusterings, leveraging multimodal input more effectively than MLM. Fig. 16B illustrates sample model outputs that do not match the human-annotated ground truth. In this example, the model confused between “header” and “other” on the top of the form, and between “question” and “answer” for the multiple choice questions on the bottom half of the form.
[0139] Fig. 17 illustrates an example method 1700 in accordance with the technology described herein. At block 1702, one or more processors of a computing system generate, for a given input document according to a graph convolutional network, graph construction to obtain a baseline graph that is associated with layout, image and text modalities. The baseline graph has a set of tokens, each given token of the set having a node comprising a vector based on content and location of a given string of text within the given input document, and one or more edges. Each edge links the node corresponding to thegiven token to a neighboring node corresponding to another token of the set of tokens. At block 1704, the method includes performing, by the one or more processors, image feature extraction on the given input document according to the baseline graph. Then at block 1706, the method includes performing, by the one or more processors, stochastic graph corruption on the baseline graph according to the image feature extraction to generate a pair of corrupted graphs. A first one of the corrupted graphs is generated by discarding first selected percentages of edge-level features and node-level features of the baseline graph. A second one of the corrupted graphs is generated by discarding second selected percentages of the edgelevel features and node-level features of the baseline graph. The node-level features are associated with the text modality of the baseline graph and the edge-level features are associated with the layout and image modalities of the baseline graph. And at block 1708, the method includes performing, by the one or more processors, graph contrastive learning between features of the pair of corrupted graphs to generate a trained self-supervised multimodal model.
[0140] Unless otherwise stated, the foregoing alternative examples are not mutually exclusive, but may be implemented in various combinations to achieve unique advantages. The technology can be used for many different types of information extraction, and is particularly beneficial for applications that handle form-like documents that include both text and graphics or other imagery. This may include, by way of example, an accounting application that handles scanned receipts, a medical application that receives paperwork from patients that filled out various forms, or job or school application software that parses information from applicants. In such applications, multimodal GCL can effectively identify and extract important information from the various types of input documents. The methods and arrangements disclosed herein can be applied to multimodal understanding in general.
[0141] As these and other variations and combinations of the features discussed above can be utilized without departing from the subject matter defined by the claims, the foregoing description of exemplary systems and methods should be taken by way of illustration rather than by way of limitation of the subject matter defined by the claims. In addition, the provision of the examples described herein, as well as clauses phrased as “such as,” “including,” “comprising,” and the like, should not be interpreted as limiting the subject matter of the claims to the specific examples; rather, the examples are intended to illustrate only some of the many possible embodiments. Further, the same reference numbers in different drawings can identify the same or similar elements.
Claims
CLAIMS1. A processing system, comprising: memory configured to store one or more input documents, each input document including text and imagery; and one or more processors operatively coupled to the memory, the one or more processors being configured to: generate, for a given input document according to a graph convolutional network, graph construction to obtain a baseline graph that is associated with layout, image and text modalities, the baseline graph having a set of tokens, each given token of the set having a node comprising a vector based on content and location of a given string of text within the given input document, and one or more edges, each edge linking the node corresponding to the given token to a neighboring node corresponding to another token of the set of tokens; perform image feature extraction on the given input document according to the baseline graph; perform stochastic graph cormption on the baseline graph according to the image feature extraction to generate a pair of corrupted graphs, a first one of the corrupted graphs being generated by discarding first selected percentages of edge-level features and node-level features of the baseline graph, a second one of the corrupted graphs being generated by discarding second selected percentages of the edge-level features and node-level features of the baseline graph, wherein tire node-level features are associated with the text modality of the baseline graph and the edge-level features are associated with the layout and image modalities of the baseline graph; and perform graph contrastive learning between features of the pair of corrupted graphs to generate a trained self-supervised multimodal model.
2. The processing system of claim 1, wherein the image feature extraction is configured to capture similar patterns within one token and / or dissimilar patterns or separations between tokens.
3. The processing system of claim 1, wherein the image feature extraction applies a convolutional neural network to extract dense image features on the whole document image.
4. The processing system of claim 1, wherein the image feature extraction includes region of interest (ROI) pooling to pool the features within a bounding box that joins a pair of tokens connected by a graph convolutional network edge.
5. The processing system of claim 4, wherein the processing system is further configured to apply a convolutional neural network on the pooled features for refinement.
6. The processing system of claim 1, wherein the processing system is further configured to concatenate extracted image features with layout features at edges of the baseline graph.
7. The processing system of claim 1, wherein the second selected percentages are different than the first selected percentages.
8. The processing system of claim 1, wherein the stochastic graph corruption is performed by adopting imbalanced drop-rates of modalities between the pair of corrupted graphs.
9. The processing system of claim 1, wherein discarding the first and second selected percentages of edge-level features includes both edge dropping and edge feature dropping.
10. The processing system of claim 1, wherein the second selected percentages are complementary to the first selected percentages.
11. The processing system of claim 1, wherein the first and second selected percentages are between 20% and 80%.
12. The processing system of claim 1, wherein the first selected percentages include different percentages for each of the layout, image and text modalities thereof, and the second selected percentages include different percentages for each of the layout, image and text modalities thereof.
13. The processing system of claim 1, wherein the graph convolution network includes a graph convolution network encoder and an extended transformer construction decoder.
14. The processing system of claim 13, wherein the stochastic graph corruption is performed on the graph convolution network encoder.
15. The processing system of claim 14, wherein the stochastic graph corruption is not performed on the extended transformer construction decoder.
16. The processing system of claim 1, wherein the processing system is further configured to apply the trained self-supervised multimodal model to a form document to identify one or more features of the form document.
17. The processing system of claim 1, wherein the trained self-supervised multimodal model is configured to identify which pair of nodes across all pairs of corrupted nodes came from a same node.
18. A computer-implemented method, comprising: generating, by one or more processors of a computing system for a given input document according to a graph convolutional network, graph construction to obtain a baseline graph that is associated with layout, image and text modalities, the baseline graph having a set of tokens, each given token of the set having a node comprising a vector based on content and location of a given string of text within the given input document, and one or more edges, each edge linking the node corresponding to the given token to a neighboring node corresponding to another token of the set of tokens; performing, by the one or more processors, image feature extraction on the given input document according to the baseline graph; performing, by the one or more processors, stochastic graph corruption on the baseline graph according to the image feature extraction to generate a pair of corrupted graphs, a first one of the corrupted graphs being generated by discarding first selected percentages of edge-level features and nodelevel features of the baseline graph, a second one of the corrupted graphs being generated by discarding second selected percentages of the edge-level features and node-level features of the baseline graph, wherein the node-level features are associated with the text modality of the baseline graph and the edgelevel features are associated with the layout and image modalities of the baseline graph; and performing, by the one or more processors, graph contrastive learning between features of the pair of corrupted graphs to generate a trained self-supervised multimodal model.
19. The computer-implemented method of claim 18, wherein the image feature extraction: is configured to capture similar patterns within one token and / or dissimilar patterns or separations between tokens;applies a convolutional neural network to extract dense image features on the whole document image; or includes region of interest (ROI) pooling to pool the features within a bounding box that joins a pair of tokens connected by a graph convolutional network edge.
20. The computer-implemented method of claim 18, further comprising concatenating extracted image features with layout features at edges of the baseline graph.
21. The computer-implemented method of claim 18, wherein the graph convolution network includes a graph convolution network encoder and an extended transformer construction decoder.
22. The computer-implemented method of claim 21, wherein the stochastic graph corruption is performed on the graph convolution network encoder and the stochastic graph corruption is not performed on the extended transformer construction decoder.
Citation Information
Patent Citations
Structural encoding and attention paradigms for sequence modeling
WO2023027701A1
Cited By
Table processing method and device, storage medium, program product and electronic equipment
CN119830882A
Visual document information extraction method of graph neural network based on attention correction
CN119919954A
Visual document information extraction method based on attention-corrected graph neural network
CN119919954B
Drug supervision code batch identification method and system based on neural network
CN120236294A
Automatic detection method and system for mobile phone shell
CN120561825A
