Form2Seq : A Framework for Higher-Order Form Structure Extraction
Paper · 2020 · Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar et al.
Summary
Moving a form from a fixed page to a smaller screen requires an understanding of its organization. A conversion system must preserve the association between a question and its response spaces, distinguish neighboring sets of alternatives, and retain instructions that apply to an entire collection. Form2Seq investigates how to recover these relationships when the small components of a form have already been located. Its inputs are text blocks and empty response areas, together with their positions. Its outputs describe the functions of those components and their membership in larger structures.
The paper separates this work into role recognition and structural grouping. Role recognition assigns categories such as section title, field caption, bullet, or choice widget. Grouping reconstructs text fields, individual choice fields, and collections of related choices. These structures can overlap hierarchically: a caption and its selectable response area can constitute a choice field, while that field also participates in a larger choice group. Form2Seq represents these relationships through membership identifiers, allowing several elements to be connected without defining their relationship solely through an enclosing image region.
The architecture processes a page as an ordered collection of meaningful objects. It derives a representation from the words within each text block, attaches the object’s bounding-box coordinates, and uses recurrent processing to incorporate surrounding elements. A sequential decoder predicts either roles or memberships, consulting the encoded page through attention. In the strongest grouping configuration, a role-prediction branch supplies its internal decoder representations to a separate grouping branch. Both branches learn together. This connection tests the authors’ hypothesis that understanding what an element does can help determine which structure contains it.
The main experiments use the authors’ Forms Dataset, comprising 23K forms. The strongest role classifier achieves 90.06% overall accuracy. In the experiment that recovers several construct types together, Form2Seq obtains F-scores of 75.82 for text fields, 86.01 for choice fields, and 61.63 for choice groups. The compared image-segmentation systems score lower under the reported conditions. An additional study on ICDAR 2013 adapts membership prediction to table rows and columns; its average F1 is 94.7, compared with 93.4 for the cited table-recognition approach.
The findings depend on both representation and information flow. Coordinates provide useful evidence, but text and knowledge of whether an object is text or a response area improve the tested configurations. Role supervision helps grouping, although some connections between the tasks work better than others. Internal role-decoder outputs are more effective than final category probabilities in the closest architectural comparison. The evidence supports this particular approach to reconstructing document relationships from supplied elements. It leaves open the reliability of a complete conversion pipeline, the effects of imperfect upstream extraction, and performance beyond the document collections studied.
Deep dive: Form2Seq : A Framework for Higher-Order Form Structure Extraction
Form2Seq reconstructs fields and choice groups from form text and layout, testing how element roles help recover document structure. · about 37 minutes to read
The problem and its context
What must survive when a form changes shape
A form uses page arrangement to communicate how information should be supplied. Its words explain what is requested, while spacing and alignment connect those words to response areas. A nearby caption may describe an individual field. A title positioned above several alternatives may instead govern the entire collection. Recovering the text does not by itself resolve these different relationships.
The authors motivate structure extraction through document digitization. Organizations using paper documents or PDFs may want versions that can be rendered dynamically, including on devices with different screen shapes. A fixed page can rely on its original geometry to keep related material visually associated. A rearranged version needs explicit structural information so that those associations survive movement.
This makes the target more demanding than reproducing a page’s appearance. A converted form could preserve every word while assigning a response area to the wrong caption. It could also place a title near the correct alternatives without recording that the title applies to them. Such errors concern the organization of the information-collection mechanism, even when the document remains readable.
The paper discusses practical benefits that motivate this reconstruction: more convenient interaction, checks on entered values, handling of submitted information, and control over form design. These are reasons to seek structural representations. They are not themselves outcomes measured in the experiments. The research concentrates on extracting the relationships that such applications would require.
The authors choose forms because they contain varied and densely arranged structures. Their examples include fields with several response areas and groups containing multiple selectable alternatives. These are small, functional units whose distinctions can matter during conversion. A broad division into paragraphs, figures, and tables would leave much of the necessary organization unresolved.
The elementary objects and the larger constructs
The paper calls a self-contained unit of text a TextBlock. A widget is an unfilled area intended to receive information. Tools operating on PDFs can already identify some objects of these kinds. Form2Seq assumes they are available and begins from their text and bounding boxes.
These elementary objects need semantic roles. A text block might be a caption, a heading, an instruction-bearing group title, or ordinary static material. A widget might be associated with free text or with a choice. Identifying the elementary kind of an object therefore does not settle its function.
The higher-order targets connect these objects. A text field includes descriptive text and the response areas associated with it. A choice field combines its caption with the relevant choice widgets. A choice group collects related choice fields and may also include a title explaining how the collection should be completed.
The optional title is significant. Its absence does not automatically make a choice group incomplete, because some groups have no title in the authors’ definition. When a title is present, however, recovering only the alternatives omits part of the annotated structure. The task must accommodate both arrangements.
There is also nesting. A choice field can be a meaningful unit in its own right and a component of a larger group. A representation that assigns every element to only one undifferentiated partition would struggle to express these relationships. The architecture consequently provides distinct membership predictions for the relevant structural levels.
This scope distinguishes the problem from finding only the locations of fillable spaces. It also distinguishes it from extracting the values entered into completed forms. The central objects of interest are captions, widgets, and their organization as information-collection structures.
Earlier layout analysis
In the authors’ account, early document analysis often relied on explicit rules and manually selected features. Some approaches began with small components, assembled text lines, and built larger regions. Other approaches repeatedly divided a page into blocks or columns. These directions offered different ways to recover physical layout.
The distinction between building upward and subdividing downward matters because both require a choice about what evidence controls aggregation. Lines may be close without belonging to the same paragraph. A block boundary may be geometrically plausible without matching a document’s functional organization. Handcrafted procedures encode assumptions about these patterns.
The paper then describes a movement towards learned image segmentation. Fully convolutional networks for semantic segmentation provide the relevant foundation: an image-processing architecture can produce category decisions over spatial locations. Applied to documents, this supports predictions for regions such as paragraphs or tables without requiring every layout heuristic to be specified manually.
The related-work discussion includes systems for page segmentation, handwritten material, and table-related regions. It also mentions approaches that combine several objectives, such as contour detection and region classification. These examples establish that learned visual processing had already become an important approach to document organization.
Form2Seq challenges its suitability for closely packed form constructs under practical resolution constraints. It does not dispute that segmentation can identify document regions. The concern is whether the image representation preserves the distinctions needed for finer structural assembly.
Why dense forms create difficulty
The authors connect image resolution to training memory. Larger inputs produce more intermediate activations during a forward computation and more gradients during learning. When memory is limited, reducing the input resolution offers a practical solution. That reduction can also diminish the gaps separating neighboring structures.
This is particularly consequential when the desired output depends on distinguishing several closely positioned groups. If nearby regions become hard to separate, segmentation can merge structures that should remain independent. It may also produce incomplete regions or confuse a group title with a caption belonging to a smaller field.
The proposed alternative preserves the elementary objects as separate inputs. Once a caption and widget have distinct identities, predicting their relationship need not depend entirely on maintaining a visible gap between their pixels. Their coordinates still matter, but the relationship can be expressed directly through a shared membership identifier.
This reasoning explains the paper’s emphasis on structure rather than appearance. A region can look approximately correct while omitting a necessary member. Conversely, an explicit membership representation can specify the intended collection even when its members occupy a complicated spatial arrangement.
The argument remains tied to the chosen starting point. The small objects must already have been detected or extracted. Form2Seq shifts the structural decision onto those objects; it does not demonstrate that obtaining them from every document is straightforward.
Text and layout in related document tasks
The paper also recognizes earlier uses of textual evidence. Some cited work combines words and box coordinates to identify pre-defined entities in invoice-like documents. Such information extraction tasks share an interest in associating textual content with document position, but their desired outputs differ from the form hierarchies studied here.
The authors discuss contextual representations associated with BERT and document-oriented work such as LayoutLM. Their account places text, layout, and image features within an existing line of document research. Form2Seq’s claim concerns the structures it predicts and the sequential framework used to recover them.
Document classification supplies another nearby comparison. A system can combine textual and visual evidence to decide what kind of document it has received. That decision summarizes the document as a whole. Reconstructing fields instead requires separate, coordinated decisions about many objects within the same page.
The paper cites Hierarchical Attention Networks as an example of building textual representations at several levels. It also describes document classifiers using visual features from MobileNets and textual features from subword-enriched word vectors. These approaches illustrate ways of combining information, while leaving the specific form-assembly problem distinct.
Against this background, the paper asks whether ordered processing of text-bearing and empty objects can recover detailed form organization. It addresses that question through role classification, membership prediction, and comparisons that vary how the tasks exchange information.
The method, step by step
Start from objects that retain their identities
The input consists of separate text and widget collections. Each object has a box describing its location and extent. A text block additionally contains words. Maintaining object identity is essential because the final grouping decision refers back to these same objects.
The paper expresses their combination through a union:
fᵉ = fᵗ ∪ fʷ
Here fᵗ is the collection of text blocks, fʷ is the collection of widgets, and fᵉ contains both. The symbol ∪ means that the two collections are brought together. This expression describes input preparation; it is not a learned operation.
The combined objects are sorted into the sequence denoted aᵉ. The authors use the page’s reading order, proceeding horizontally from the left and moving downward. This supplies a consistent traversal for recurrent processing.
The traversal provides context that can be useful for role recognition. A list item tends to appear after its bullet. A caption and the response areas it describes tend to occur near one another. Larger groups also have recurring spatial arrangements. The framework seeks to learn these regularities from ordered elements.
Sequence position is only one part of the representation. Sorting a page inevitably compresses a spatial arrangement into a traversal, so the original box information accompanies each object. The system can therefore use both the chosen order and the geometry that order does not fully express.
Form2Seq structural reconstruction
The steps in order.
The diagram describes the cascaded grouping design. The standalone role classifier ends with category prediction, while the isolated grouping configuration omits the role-information connection. The experiments compare these alternatives instead of assuming that every application requires the full cascade.
Represent the spatial evidence
For an arranged element, the spatial input has the following form:
sᵃᵢ = (x, y, w, h)
The symbol sᵃᵢ denotes the coordinates associated with the element at position i. The values x and y identify its location relative to the upper-left image corner. The values w and h describe the box’s width and height.
These quantities let the network distinguish objects that have similar places in the traversal but different spatial relationships. An item immediately following another in the sequence may lie beside it, below it, or at the beginning of another part of the layout. The coordinates preserve evidence about those distinctions.
The authors motivate the method through relative arrangements, although the described input uses these box measurements. Relationships between neighboring objects are learned through contextual processing of their representations. The paper does not introduce a separate explicit formula for pairwise distances.
This distinction helps clarify the architecture. A box representation supplies geometric observations. The context encoder then learns how those observations interact across the page. It is the combination of supplied positions and learned context that supports predictions about recurring arrangements.
Read the words within a text block
The text encoder handles each block separately before the page-level encoder processes the entire document sequence. It receives the words belonging to that block and turns them into a single textual representation.
The paper gives the within-block word sequence as:
{tᵃ}ᵢ = {wᵢ₁, wᵢ₂, …, wᵢₙ}
The expression {tᵃ}ᵢ represents the text of element i. Each w term denotes a word at a position within that element, and n indicates the final position in the block’s word sequence. The braces describe the collection as written in the paper; the encoder processes the words sequentially.
PDF-derived words can contain extraction noise. The authors therefore choose chars2vec instead of relying on standard word vectors alone. It supplies a representation for each word, allowing the subsequent text encoder to work from character-derived word information.
An LSTM processes these word representations in order. An LSTM is a recurrent component with internal states that change as successive inputs arrive. Form2Seq takes the cell state after the final word as the representation of the entire text block.
This means the text contribution is more than an isolated word lookup. A block can contain a phrase or instruction, and the inner recurrent encoder combines its words before page context is added. The resulting representation remains associated with the original block.
The implementation allows a maximum of 200 words per text block. Chars2vec produces word representations with 100 dimensions, and the text-encoding LSTM has size 100. These settings define the reported implementation. The paper does not compare alternative text-length limits or embedding sizes.
Widgets require a different treatment because they contain no words. Their textual representation is filled with zeros. This keeps their input shape compatible with that of a text block while allowing coordinates and surrounding context to carry the useful evidence.
The distinction is important for interpreting the text ablations. Giving the full system textual content also distinguishes text-bearing objects from widgets through their representations. The separate kind-flag configuration is used to examine how much can be recovered when that elementary distinction is supplied without the words themselves.
Build representations using the surrounding page
After the inner text encoder has finished, the system joins each object’s textual representation with its coordinate vector. The paper calls the resulting element representation e. Joining them by concatenation preserves both information sources as inputs to the next stage.
A bidirectional LSTM then processes the sequence of these combined representations. Its output for each element is context-sensitive: information from the surrounding arranged objects can influence how that element is represented.
Bidirectionality matters because relevant evidence can appear on either side of an element in the traversal. A caption might be clarified by following response areas. A widget might be understood through preceding text. The encoder can incorporate both directions before the decoder makes its prediction.
The authors call this component the context encoder. For the role-classification configuration, each direction has hidden size 500. The decoder that follows has hidden size 1000. These are the capacities used in the experiments, selected through validation-based tuning.
The context encoder does not directly output the final category. It prepares a representation for each object that includes the object’s own text and geometry together with evidence from the page sequence. The decoder then uses those representations while making coordinated predictions.
This arrangement separates local reading from document-level interpretation. The text encoder works inside a block. The context encoder works across blocks and widgets. Their roles are complementary: the former supplies linguistic content, while the latter places that content within the surrounding form.
Decode roles while consulting the encoded form
The role-prediction branch uses an LSTM decoder. At a given sequence position, it receives the context representation for that element and produces an output from which the category is predicted. Earlier decoding decisions condition later predictions.
The architecture draws on Sequence to Sequence Learning with Neural Networks. Here, however, the output steps correspond to the supplied document objects. The framework predicts a structured label sequence instead of generating an unconstrained passage.
The decoder also consults the encoder outputs through Bahdanau attention. Attention gives it a way to emphasize particular encoded elements when deciding the role of the current object. The authors introduce this because a form can produce a long element sequence.
The contextual outputs are collected into an attention memory:
M = [b₁; b₂; …]
M denotes the memory used by attention. Each b term is a context-encoder output for one arranged element. The semicolons indicate the stacking described by the authors, with the outputs placed column-wise.
The memory contains representations of the same input objects already processed by the context encoder. Attention provides selective access to them during decoding. It does not introduce additional document evidence from outside the supplied sequence.
A linear layer converts each decoder output into scores for the target roles, and softmax produces category probabilities. The standalone role experiment uses 10 categories. The attention layer has size 500.
The text encoder, context encoder, and role decoder are optimized together. Training uses cross-entropy and teacher forcing. With teacher forcing, the expected previous outputs guide the sequence during learning, helping the decoder acquire the relationship between preceding targets and the current decision.
The paper identifies these training components without writing out the recurrent-state equations or a full attention derivation. Its mathematical notation mainly specifies the objects, sequences, and representations being connected. The method’s precision comes primarily from its architecture and implementation settings.
Replace role labels with membership identifiers
For grouping, the framework changes the interpretation of the decoder’s output. The target is now a group identifier assigned to each object. All members of a particular annotated structure receive the same identifier.
An element that belongs to none of the relevant structures receives the reserved identifier 0. This gives the predictor an explicit output for nonmembers. A heading unrelated to the requested grouping need not be forced into a field or choice group.
The numerical identifier has a relational purpose. Its value connects elements receiving the same assignment. Correct reconstruction requires the intended members to share an identifier while unrelated members remain separated.
The authors argue that sequential dependence is especially useful here. A current decision needs to remain compatible with identifiers already predicted for preceding elements. A decoder that conditions on earlier outputs can use that history when deciding whether the current object joins an existing structure.
The isolated grouping configuration retains the broad encoder-decoder organization of role prediction. It uses a group decoder and a projection layer whose outputs correspond to group assignments. This establishes a direct grouping approach before role information is introduced.
The membership formulation preserves an important distinction between the output structure and its possible visualization. A group can be displayed as an enclosing region, but the prediction itself specifies which objects belong together. Its correctness can consequently be evaluated through those members.
Let role recognition inform grouping
The authors’ central hypothesis is that role information helps structural assembly. A text block interpreted as a choice-group title provides a different grouping cue from one interpreted as a caption for an individual alternative. Geometry may place both near widgets, making the semantic distinction useful.
The cascaded architecture shares the text encoder between the tasks. It then gives role prediction and grouping separate context encoders and separate decoders. This allows each task to develop its own contextual processing while drawing on the same block-level textual representations.
First, the role branch processes the element representations. Its decoder produces an output sequence denoted dᵗ. These outputs are joined with the original text-and-coordinate representations and passed to the grouping context encoder.
The downstream grouping branch therefore receives information about each object from two stages. The original representation preserves direct textual and spatial evidence. The role-decoder output adds a representation shaped by role supervision and sequential prediction.
Crucially, the authors use the LSTM decoder’s outputs before the final category projection. They do not pass only the final softmax probabilities in their strongest configuration. The experiments test that alternative and find it weaker.
For the cascaded setting, role supervision is adapted to the structures being grouped. It distinguishes relevant captions, group titles, and widget roles, while other text is collected into a broader category. The role task is therefore designed to support the grouping task’s distinctions.
Separate prediction layers accommodate nesting. An element may receive a field membership and a choice-group membership, allowing the same underlying object to participate at different levels. This is necessary when an individual choice field belongs within a larger collection.
The entire cascade learns jointly: the shared text encoder, both context encoders, and both decoders participate in training. The paper also evaluates alternatives with shared contextual processing, separately trained role predictions, and different connections between the branches. Joint learning is thus one design choice under examination, rather than an assumption that every shared architecture will help.
Optimization and the table adaptation
The reported training uses Adam with learning rate 1 × 10 −3. Computation takes place on a single Nvidia 1080Ti GPU. The batch size is 8, selected as the largest that fits the available memory.
Hyper-parameters are adjusted manually according to validation performance. For grouping, the context encoder and decoder use the same configuration sizes as their role-prediction counterparts. The cascaded architecture changes the connection and supervision rather than introducing an unrelated grouping mechanism.
The table experiment reuses membership prediction for a different structural target. Text objects inside a table are sorted into the same kind of reading-order sequence. One output head connects objects in the same row, while another connects objects in the same column.
The table procedure includes an additional consistency operation. For column recognition, the authors collect texts that align vertically by sharing a horizontal span. They examine the predicted column identifiers within such a set and replace them with the majority identifier.
A corresponding operation is applied when deriving the final rows. The table result therefore combines learned membership predictions with alignment-based reassignment. The paper presents both as parts of the working procedure; it does not report the final table score as the unaided output of the decoder.
Experiments and results
What the Forms Dataset contains
The form experiments use a collection described as 23K forms, spanning domains including insurance, finance, medicine, and government use. The government examples encompass different administrative settings. This variety supports the authors’ aim of studying multiple arrangements of information-collection structures.
Annotations cover the elementary objects and the larger groups. Annotators mark boxes for higher-order constructs and identify their constituent elements. The authors describe repeated review rounds in which they supplied correction guidance for particular structures and patterns.
Each form is initially annotated by one person and reviewed by another. According to the paper, ∼85% needed no changes during review. Minor corrections were made for the remaining 15%. These figures describe the review process; they do not quantify agreement separately for every role or membership decision.
The role categories have uneven frequencies. For TextField Caption, the reported training/test counts are 129k/31.6k. Choice Field Caption has 35k/8.9k, while ChoiceField Widget has 39.2k/9.94k. These are element counts, so they should not be read as numbers of forms.
The rarer organizational labels also have substantial annotations. ChoiceGroup Title is reported at 8.92k/2.28k for training/testing, and Header Title at 10.2k/2.57k. Section Title has 28.5k/7.25k.
For list-related roles, Bullet has 56.4k/14.2k and List Item has 58.9k/14.7k. The dataset also includes text widgets and static text. These distributions help explain why category-level accuracy is useful alongside the aggregate result: different roles contribute different numbers of examples.
The authors state that the counts for text fields and choice fields follow their respective caption counts. For the larger choice groups, they report a training/test distribution of 15.5k/1.76k. A group is a separate evaluation object from any individual element contained within it.
The paper names the collection the Forms Dataset and announces an intended partial release. Legal restrictions prevent distribution of the entire collection. The authors describe the planned subset as representative and richly annotated, but the paper’s announcement does not establish what subsequently became available.
How the image comparisons are constructed
The principal image baselines are DeepLabV3+ and MFCN. Both approach the task through segmentation. To make the comparison more informative, the authors implement variants with different prior information.
One variant receives the form image alone. Another also receives masks indicating the text blocks and widgets. This matters because Form2Seq starts from those elementary objects. Supplying their masks gives the segmentation approach access to a related source of prior information.
The authors retain the stronger variant for each baseline. MFCN performs better without the added prior in their experiments, whereas DeepLabV3+ benefits from it. The reported baseline results should therefore be understood as the selected variants, instead of a uniform input configuration imposed on both systems.
Input images undergo an aspect-preserving resize to 792x792. MFCN also receives class-loss scaling based on pixel area, following the procedure described in its earlier work. These details affect how the segmentation systems learn from classes occupying different amounts of image space.
For role classification, pixel predictions must be translated into labels for the supplied objects. The authors take the most common predicted category among the pixels inside each element’s box. This majority-voting step connects image output to the element-level accuracy measure.
Group extraction requires a different comparison. A predicted region is matched to an annotated group using intersection over union, or IoU. This measure compares spatial overlap between regions. The baseline matching threshold is reported as 0.40 in the detailed comparison.
The baseline procedure therefore measures whether a region overlaps sufficiently with a reference structure. Form2Seq’s main grouping measure instead checks the identities of the members. The paper explicitly distinguishes these conditions and additionally evaluates its strongest choice-group configuration under the overlap criterion.
Role-classification accuracy
The role-classification experiment compares the image baselines with several Form2Seq input settings. The coordinates-only setting is A_T. B_T adds an elementary kind indicator specifying whether the object is text or a widget. C_T uses textual content and coordinates without receiving B_T’s additional bit.
The main aggregate metric is overall accuracy across classified elements. The ordering of the reported settings shows that spatial information has value, that elementary object identity adds substantial help, and that the full textual configuration performs best overall.
Forms Dataset role classification, overall accuracy
The configuration using words and box coordinates has the highest reported overall accuracy.
The numbers
| System or setting | accuracy % |
|---|---|
| MFCN | 48.59 |
| DeepLabV3+ | 84.18 |
| Form2Seq A_T, coordinates | 76.92 |
| Form2Seq B_T, coordinates and kind | 88.87 |
| Form2Seq C_T, words and coordinates (this paper) | 90.06 |
The overall result does not describe every category equally well. In C_T, Choice Widget accuracy is 91.83, Text Widget accuracy is 96.89, and Choice GroupTitle accuracy is 78.93. The latter remains more difficult despite the strong aggregate score.
Other C_T results include 90.53 for Choice Caption and 91.27 for TextField Caption. Header Title reaches 85.88, whereas Section Title reaches 67.48. These differences show that distinguishing organizational text can remain challenging even when field-related roles are recognized more reliably.
The list-related results are 93.55 for Bullet and 90.78 for List Item. Static Text reaches 85.31. The system’s performance thus varies across ordinary text, structural headings, and the objects directly associated with response fields.
The image baselines also show uneven behavior. MFCN has reported accuracy of 0.0 for Choice Widget, Choice GroupTitle, and Choice Caption. Its overall score therefore conceals particularly severe difficulty on roles central to the grouping task.
DeepLabV3+ performs more strongly overall, but the authors point to weaknesses involving choice widgets, bullets, and static text. Their visual examples show that a segmentation output can confuse the functional role of text surrounded by response areas.
The classification results support the full textual configuration at the aggregate level. They do not show that adding words produces a higher score for every role. The ablation section examines those exceptions and the distinction between content and an elementary kind indicator.
Choice groups under exact membership
The initial grouping study focuses on choice groups alone. The evaluation treats a prediction as correct only when it contains precisely the annotated text blocks and widgets. Omitting an included title, adding an unrelated widget, or merging neighboring groups prevents an exact match.
This is an object-membership criterion. The predicted group’s display box is secondary to the set of elements it connects. That choice aligns evaluation with the intended structural use, where an incorrect relationship may matter even if an enclosing region appears plausible.
For E_G, the strongest configuration in this study, recall is 58.67 and precision is 60.81. Its F-score is 59.72. Recall measures how many reference groups are recovered, while precision measures how many predicted groups qualify as correct.
The isolated grouping setting, A_G, has F-score 53.24. Other architectural variants change the training relationship or the information supplied from role prediction. Their results range from weaker than isolated grouping to the strongest E_G result, showing that the connection between tasks matters.
The baseline choice-group F-scores are 44.14 for DeepLabV3+ and 13.96 for MFCN. These baseline figures use region overlap rather than Form2Seq’s exact-membership condition. The comparison favors Form2Seq despite its more demanding main test, but the measurements still need to be identified accurately.
When E_G is evaluated using IoU threshold 0.40, its recall becomes 74.3, precision 78.6, and F-score 76.3. These are scores for approximate spatial matching. They should not replace the exact-membership result when describing complete structural recovery.
The gap between the two evaluations illustrates a substantive distinction. A predicted region can be close enough spatially to qualify under IoU while its membership remains imperfect. Reporting both makes the result easier to interpret for applications requiring different kinds of correctness.
Recovering fields and groups together
A separate experiment predicts text fields, choice fields, and choice groups simultaneously. This setting is closer to the full structural task because it must recover units at different levels instead of concentrating on one construct type.
The segmentation baselines receive separate prediction heads connected to their penultimate representations. This allows them to produce separate masks for overlapping structures. Without that provision, a single segmentation assignment would have difficulty representing both a field and its enclosing group.
The chart compares F-scores within this simultaneous-extraction experiment. Each construct has its own reference structures and predictions; the values are not a pooled score across all group types.
Forms Dataset simultaneous construct extraction, F-score
Form2Seq leads both segmentation baselines for every construct evaluated in the joint setting.
The numbers
| System or setting | F-score |
|---|---|
| Text fields, MFCN | 38.0 |
| Text fields, DeepLabV3+ | 38.62 |
| Text fields, Form2Seq (this paper) | 75.82 |
| Choice fields, MFCN | 19.6 |
| Choice fields, DeepLabV3+ | 51.73 |
| Choice fields, Form2Seq | 86.01 |
| Choice groups, MFCN | 28.77 |
| Choice groups, DeepLabV3+ | 47.83 |
| Choice groups, Form2Seq | 61.63 |
For text fields, Form2Seq’s recall is 71.59 and its precision is 80.6. DeepLabV3+ reports recall 43.64 and precision 34.63. MFCN reports recall 37.12 and precision 38.94. These component metrics provide context for the F-score comparison.
For choice fields, Form2Seq achieves recall 83.48 and precision 88.71. The DeepLabV3+ figures are 61.93 and 44.42, while MFCN reports 31.45 and 14.24. The individual choice-field task is the strongest of the reported Form2Seq construct results in this setting.
Choice groups remain more difficult. Form2Seq’s recall is 59.27 and precision is 64.2. DeepLabV3+ has recall 43.25 and precision 53.5; MFCN has recall 30.99 and precision 26.85.
The different difficulty levels are understandable from the task definitions. A choice group can include several fields and a title, creating more opportunities for a membership mismatch. This is an interpretation of what the evaluation demands, instead of a measured decomposition of the causes of each error.
The simultaneous results should also remain separate from the choice-group-only experiment. The paper reports different values for those settings because they are distinct training and evaluation configurations. Their relationship cannot be reduced to a single headline choice-group score.
What the visual examples add
The paper includes examples intended to make the structural errors concrete. In one comparison, adding text allows the system to include a group title that the version without text misses. The resulting membership is complete rather than merely close in location.
Other illustrations show segmentation confusing the role of a title near widgets. The authors interpret these errors as evidence that dense layouts and surrounding response areas can make visual segmentation struggle with the function of a text region.
For grouping, the examples include merged or incomplete baseline predictions. MFCN is described as failing to connect the title and choice fields across their horizontal arrangement. DeepLabV3+ recognizes some groups while producing incomplete predictions elsewhere.
In the illustrated example, Form2Seq recovers 7 out of 8 choice groups. That count describes the depicted case. It should not be treated as a replacement for the dataset-wide recall or as an independently estimated frequency of a particular error type.
The visual evidence complements the aggregate metrics by showing recognizable failure patterns. It does not establish how often each pattern occurs across the full test collection, because the paper does not report a comprehensive error taxonomy.
Table rows and columns
The additional table study uses ICDAR 2013, described as containing 156 tables across US and EU portions. Following the cited comparison strategy, the authors use 125 tables for training and 31 for testing.
The target is membership of table text in rows and columns. This is related to form grouping because both tasks connect supplied text objects into larger structures. It differs in its output definitions and in the alignment-based reassignment applied after prediction.
For rows, the comparison system from Siddiqui and colleagues has precision 95.3, recall 94.2, and F1 94.8. Form2Seq reports precision 94.2, recall 96.1, and F1 95.1. Its row F1 is higher even though its row precision is lower.
For columns, the comparison system reports precision 91.6, recall 92.6, and F1 92.1. Form2Seq reports precision 95.7, recall 92.9, and F1 94.3. The paper also gives average results across the row and column tasks.
ICDAR 2013 table recognition, average F1
The Form2Seq table procedure exceeds the cited comparison on average F1.
The numbers
| System or setting | F1 |
|---|---|
| Siddiqui and colleagues | 93.4 |
| Form2Seq (this paper) | 94.7 |
The average precision and recall for Form2Seq are 95.0 and 94.5. The comparison reports 93.4 for each. The authors characterize their table performance as state of the art in the context of that evaluation.
The demonstrated result is narrower than a claim that an unchanged form parser automatically understands tables. The framework is trained for row and column targets, uses separate prediction heads, and applies alignment-based processing. Its success shows that the membership formulation can support another document-structure task with those adaptations.
What the ablations show
Spatial regularity is useful, but elementary identity matters
The role-classification ablations begin with a deliberately restricted input. A_T receives box coordinates without words or an explicit text/widget distinction. Its overall accuracy is 76.92.
This result indicates that placement and dimensions contain predictive information about roles. Forms are organized rather than arbitrary collections of objects. A contextual sequence can exploit recurring arrangements even when it cannot read captions or directly identify the elementary object kind.
B_T adds the text/widget bit and obtains 88.87 overall accuracy. The comparison reveals how much the task benefits when the predictor no longer has to infer that basic distinction solely from geometry.
The change is meaningful because elementary identity and semantic role are different levels of information. Identifying an object as a widget limits the roles it could have, yet leaves unresolved whether it belongs to a choice field or a text field. Knowing that it is text still leaves captions, headings, bullets, and ordinary material to be distinguished.
The authors describe the aggregate improvement from A_T to B_T as ∼ 12%. That characterization belongs to their report. The underlying accuracy values are the more precise description of the compared configurations and avoid ambiguity about how an improvement is expressed.
The coordinate-only setting should consequently be read as a restricted test of layout evidence. Its limitations do not imply that geometry is unimportant. They show that geometry alone leaves distinctions unresolved that a simple object-kind cue can remove.
Words contribute beyond a text/widget flag
C_T replaces the flag-based input arrangement with textual representations and coordinates. Its overall accuracy is 90.06. The authors report the aggregate improvement over B_T as 1.19%.
The category comparisons reveal where content is especially useful. Section Title accuracy is 57.02 for B_T and 67.48 for C_T. Wording can help distinguish organizational labels that might otherwise look similar through their position and box dimensions.
Choice GroupTitle moves from 76.81 in B_T to 78.93 in C_T. Static Text is 82.18 in B_T and 85.31 in C_T. These comparisons support the usefulness of linguistic evidence for deciding what nearby text is doing.
Other categories also favor C_T, including Choice Widget at 91.83 compared with B_T’s 90.84, and Bullet at 93.55 compared with 91.58. Because the entire page is contextually encoded, textual information can influence decisions about objects whose own words are absent or limited.
The pattern nonetheless contains exceptions. B_T has Text Widget accuracy 98.26, whereas C_T has 96.89. For TextField Caption, the reported values are 91.36 and 91.27. List Item is 90.91 in B_T and 90.78 in C_T.
These exceptions prevent a claim that content improves every class. They also underline why an overall score is insufficient for understanding a structural system. A configuration can lead in aggregate while yielding lower accuracy on a particular component role.
There is a further experimental qualification. C_T does not keep B_T’s extra kind bit and simply append text. The comparison changes the input configuration by removing that explicit flag while introducing textual representations. It establishes the practical value of the full textual setting, but it is not an otherwise identical feature-addition test.
Role supervision and grouping are related
The grouping ablations examine a different question: how should role information reach membership prediction? The baseline within Form2Seq is A_G, which learns grouping in isolation. Its choice-group F-score is 53.24.
B_G trains role recognition and grouping together using a shared context encoder. The role decoder attends to contextual outputs, while the grouping decoder has access to contextual and role-decoder outputs through separate attention. Its F-score is 54.65.
This comparison supports the proposed relationship between the tasks. Adding role supervision and a pathway for its information improves the tested shared-context architecture. It does not yet establish which part of that design is responsible for the change.
C_G takes another route. Role recognition is trained separately, and its classification outputs enter the grouping context encoder through a nondifferentiable connection. This setting obtains F-score 56.51.
That result is important because it shows that useful role information need not arise only through a single jointly optimized pipeline. A separately trained source can also help grouping. The experiment therefore supports the usefulness of the information while keeping the training arrangement open to comparison.
The configurations differ in several architectural details, so their ordering should not be interpreted as a clean test of only joint versus separate optimization. The paper supplies a series of practical designs whose combined differences affect the result.
Internal outputs outperform final probabilities
D_G and E_G provide the most direct comparison of what representation to pass downstream. Both use separate context encoders for role prediction and grouping. They differ in the outputs supplied from the role branch.
D_G passes the softmax outputs from the role projection layer, joining them with text and spatial representations. Its choice-group F-score is 52.77. E_G instead passes the role LSTM decoder outputs and obtains 59.72.
This result shows that a seemingly reasonable interface can be weaker than an internal representation. Final probabilities summarize evidence in the terms demanded by the role categories. The decoder output may preserve distinctions that remain useful for grouping even when they are not required by the final classification.
That interpretation is consistent with the architecture, but the paper does not inspect the representations closely enough to establish exactly what extra information is retained. There is no dimension-by-dimension account of which linguistic or spatial relationships cause E_G’s advantage.
The empirical conclusion is therefore specific: in the compared cascade, using the internal decoder outputs is more effective than using the final softmax outputs. A broader claim that internal states always improve downstream structure prediction would exceed this experiment.
D_G also illustrates why the paper’s contribution cannot be reduced to “joint tasks help.” Its result is weaker than several alternatives despite connecting role prediction to grouping. The information pathway and the representation carried through it are consequential design choices.
Text also improves exact group reconstruction
F_G removes textual content from the E_G design and supplies coordinates with the elementary kind signal. Its F-score is 55.65, compared with E_G’s 59.72. The authors describe the advantage of the text-bearing configuration as 4.07 points.
The associated example concerns a group title. The configuration without words fails to include it, while the textual configuration recovers the complete choice group. This gives a concrete explanation of how linguistic evidence can affect exact membership rather than merely local role accuracy.
A title is structurally important when the annotation includes it. Recovering the choice fields without the title may produce a useful partial group, but it does not satisfy the paper’s exact condition. Text can help recognize that a nearby block governs the collection.
The example should not be generalized into a complete account of the ablation result. Text may help through several kinds of decisions, and the paper does not quantify the contribution of title errors separately. The controlled comparison establishes an overall benefit, while the figure illustrates one plausible pathway.
Which components remain unanalyzed
The paper does not offer a corresponding ablation for every architectural component. Attention is part of the reported configurations, but its independent contribution is not measured by removing it in an otherwise matched comparison.
The same applies to the reading-order convention. The authors motivate their traversal through recurring spatial relationships, yet do not compare alternative traversals or systematically perturb the supplied order. The evidence supports the complete sequence-based configuration without identifying an optimal ordering strategy.
The table study also lacks a reported comparison that removes alignment-based reassignment. Its scores therefore cannot reveal how much comes from the recurrent grouping predictions and how much comes from the consistency operation.
These missing comparisons define the reach of the explanation. The paper provides substantial evidence about textual input, elementary kind information, and several connections between role prediction and grouping. Other decisions remain components of the successful implementation whose individual effects have not been isolated.
Limitations
Constraints explicitly acknowledged by the authors
The clearest stated restriction concerns access to the Forms Dataset. Legal issues prevent the authors from releasing the entire collection. They announce plans for a substantial annotated subset, which could support further work, but a subset would not automatically permit exact reproduction of experiments using the complete data.
The authors also acknowledge noise in text obtained from PDFs. Their choice of chars2vec responds to that problem within the word-representation stage. This addresses how the system represents noisy strings; it does not establish that the upstream extraction process has recovered every required word or object correctly.
Memory constraints are explicit in the implementation. The batch size is chosen to fit the available GPU, and the motivation for an element-based representation emphasizes the cost of high-resolution image processing. The baseline input size must be interpreted within those experimental conditions.
The paper’s chosen scope is also clear. It investigates particular form roles and information-collection structures, then adapts the framework to table rows and columns. It does not present measured coverage of every possible document hierarchy.
These statements are constraints and scope boundaries supplied by the authors. Other limitations follow from what the experiments do and do not test. Those require a careful distinction between an observed result and a reasonable question left unanswered.
Dependence on the supplied elementary objects
A limitation visible in the setup is the assumption that text blocks and widgets are already available. A missing widget cannot be assigned to its proper field if it never enters the sequence. A caption merged with unrelated text is represented as one object even if the intended structure needs them separated.
The paper does not report a controlled study of such upstream errors. It therefore does not establish how rapidly grouping quality degrades when elementary extraction becomes less accurate. Its main evidence concerns interpreting the objects supplied to the framework.
This boundary is particularly relevant to the comparison with image processing. Form2Seq avoids making every structural decision through a rasterized page, but it still depends on earlier processing that identifies the objects. The overall reliability of that larger pipeline cannot be inferred from grouping scores alone.
The text encoder’s handling of noisy words only partially addresses this issue. An unusual or corrupted word inside the correct text block is different from an absent block, an incorrect boundary, or an undetected response area. The experiments do not separately characterize these failure modes.
There is also no reported analysis of the maximum text-length setting. A block exceeding 200 words encounters the implementation’s limit, but the paper does not quantify how frequently this matters or compare alternative limits. The setting is an operational detail instead of a demonstrated harmless constraint.
Ordering and coordinate assumptions
The framework commits to a particular traversal of the page. That convention may place related objects near one another, but a form can contain multiple regions whose functional relationships are not fully captured by a simple reading sequence.
The coordinates provide additional evidence, so the architecture does not lose all spatial information. Nevertheless, the paper does not show whether another traversal would improve or weaken its predictions. Robustness to an imperfect supplied order remains unmeasured.
The spatial representation is described through pixel coordinates and box dimensions. The text does not provide a detailed analysis of scale changes, transformations of coordinates, or alternative encodings. A reader should not infer geometric invariance merely from the use of contextual processing.
Likewise, the authors’ motivation emphasizes relative arrangement, but the architecture learns from the supplied box vectors rather than from a fully specified relational geometry. The experiments do not separate the value of absolute placement from that of learned relations between positions.
These are limits on interpretation, not demonstrations that the method fails under such changes. The necessary comparisons are absent. The published scores establish performance for the representation and data preparation actually used.
Membership decoding and structural guarantees
Group identifiers express useful relationships, but the description leaves some implementation details unresolved. The paper does not fully specify how all numbering conventions and output-capacity choices interact with unusual group arrangements.
The sequential decoder also conditions current predictions on earlier outputs. That is useful for consistency, yet it creates a possible route for previous mistakes to influence later assignments. No dedicated analysis measures that propagation.
Training uses teacher forcing, while prediction depends on the system’s own previous decisions. The paper names the training procedure but does not investigate the consequences of this difference for long form sequences or difficult grouping cases.
Nor does the architecture description supply an explicit guarantee that every predicted group satisfies all the semantic requirements in the task definitions. A predicted membership set can be evaluated against an annotation, but the paper does not report a separate validity checker enforcing field composition.
Nesting is supported through distinct outputs, which is necessary for the target structures. The experiments do not demonstrate arbitrary hierarchical depth or a general mechanism for every possible relation between document components.
These observations concern the limits of the demonstrated formulation. They do not diminish its practical success on the reported tasks. They prevent that success from being expanded into a claim of unrestricted structural reasoning.
What the evaluation captures and hides
Exact membership is well suited to detecting incomplete reconstruction. It also compresses several kinds of error into the same failed match. Omitting a title, adding a nearby widget, and merging collections can all make a group incorrect.
The paper’s illustrations help explain some of these cases, but there is no dataset-wide accounting of their relative frequency. As a result, the F-score alone cannot tell a developer which repair would address most errors.
Conversely, an IoU threshold accepts some spatial approximations. Its score measures a different objective from complete membership. The authors report both conditions for their strongest standalone choice-group configuration, making the difference visible.
The principal baseline comparison nevertheless involves outputs and matching rules of different kinds. Form2Seq is evaluated through exact membership, while the segmentation systems are primarily evaluated through region overlap. The result is informative, but it is not a perfectly uniform test of interchangeable outputs.
The claim that exact matching is stricter rests on preserving all of the required elementary members. It should not be stretched into a complete theory of every geometric ambiguity. The essential practical point is that approximate localization and complete structural reconstruction answer different questions.
The annotation process also introduces a boundary on certainty. Review by another annotator is useful quality control, but the reported correction percentages do not quantify independent agreement on all role and grouping decisions. Exact evaluation assumes that the resulting reference memberships are the appropriate targets.
Scope of the empirical claims
The experiments compare particular segmentation implementations at a particular image size. They support the conclusion that Form2Seq performs better under those conditions. They do not show that visual evidence is inherently unhelpful or that every future image-based approach must suffer the same errors.
The framework itself does not use visual features, but the paper does not test a version that combines its element sequence with an additional image representation. As a consequence, its results cannot establish that adding appearance would never help distinguish roles or groups.
The authors report fewer parameters for their grouping system: 31.2 million, compared with DeepLabV3+ at 59.4 million. This is a useful architectural comparison. It does not directly measure execution speed, peak memory, energy use, or performance on a different hardware platform.
The main scores are not accompanied by repeated-run variation or confidence intervals. The reported ordering is clear, but the text does not provide a detailed estimate of uncertainty arising from training randomness.
Dataset breadth also has limits. Forms come from several domains, yet the paper does not supply separate generalization tests for every source, layout family, or extraction condition. Diversity within a collection does not on its own establish performance on all unseen form designs.
The table experiment is an adaptation trained on table-specific targets. It does not demonstrate that a system trained only on forms transfers unchanged. Its alignment-based reassignment is part of the evaluated result, and its separate effect remains unknown.
Finally, the practical motivation extends beyond the measured endpoint. Reflow, interactive rendering, and improved form completion require more than role labels and memberships. The paper does not report a complete user-facing conversion evaluation or a study of how people fill the resulting forms.
The strongest supported conclusion is therefore a structural one. Given identified elements and their coordinates, the framework can recover useful roles and relationships, and its tested cascade outperforms the compared alternatives. Whether those predictions suffice for a particular downstream application requires evaluation of that application as well.
What came after
MessToClean: Evidence-Grounded Structure-Preserving Reconstruction for Real-World Degraded Exam Paper Images is listed as a citing work from 2026. Its title identifies reconstruction of degraded exam-paper images as its subject, with an emphasis on evidence and preservation of structure.
That citation establishes a connection in the later literature. The available record does not describe which aspect of Form2Seq MessToClean discusses or uses. It does not say whether the later work adopts membership identifiers, follows the sequential architecture, includes a comparison, or mentions Form2Seq when reviewing document-structure research.
As a result, the relationship cannot support a more detailed account of technical inheritance or subsequent performance. The later work’s stated subject shares an interest in retaining document organization, but a shared concern is insufficient evidence that it carries forward the same mechanism.
Form2Seq’s documented contribution remains the combination tested in its own experiments: meaningful elementary objects, textual and geometric evidence, sequential contextual processing, and a cascade through which role recognition assists grouping. The later citation shows that the work continued to be referenced; the record does not establish which of those contributions shaped the citing system.
Cite
Cite as Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar and Balaji Krishnamurthy. 2020. Form2Seq : A Framework for Higher-Order Form Structure Extraction. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP).
@inproceedings{aggarwal2020form2seq,
title = {{Form2Seq : A Framework for Higher-Order Form Structure Extraction}},
author = {Milan Aggarwal, Hiresh Gupta, Mausoom Sarkar and Balaji Krishnamurthy},
booktitle = {Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
year = {2020},
doi = {10.18653/v1/2020.emnlp-main.314},
url = {https://doi.org/10.18653/v1/2020.emnlp-main.314}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/aggarwal-2020-form2seq-framework-higher-order-form/