StruBERT: Structure-aware BERT for Table Search and Matching

Mohamed Trabelsi, Zhiyu Chen, Shuo Zhang, Brian D. Davison, Jeff Heflin

TL;DR

This paper introduces StruBERT, a novel BERT-based model that effectively fuses a table's textual (caption, title) and structural (rows, columns) information for improved table search and matching. By introducing "horizontal self-attention" alongside existing "vertical self-attention," StruBERT captures a more comprehensive understanding of table content, leading to significant performance gains across three key table-related tasks.

What Problem Does This Paper Address?

The vast amount of information stored in web tables presents a challenge for effective retrieval and matching. Previous approaches often treated a table's textual metadata (like captions) and its inherent structure (rows and columns) as separate entities, failing to capture their crucial interplay. This limitation hinders tasks like finding relevant tables based on keywords, identifying tables similar to a given example, and even classifying table similarity. The authors aim to bridge this gap by developing a model that deeply integrates both textual and structural information for a more holistic representation of tables.

Methods

The core innovation is StruBERT, a structure-aware BERT model. It begins by creating two types of sequences from a table: column-based sequences (concatenating cell values within a column, along with textual metadata) and row-based sequences (concatenating cell values within a row, also with metadata). These sequences are then encoded using BERT.

The key novelty lies in the self-attention mechanisms:

  • Vertical Self-Attention: This mechanism, inspired by prior work (like TaBERT), operates on row-based sequences to capture column-level dependencies.
  • Horizontal Self-Attention: This is the paper's novel contribution. It operates on column-based sequences to capture row-level dependencies.

By combining these, StruBERT generates four types of features:

  1. Fine-grained row embeddings: Capturing detailed row context.
  2. Fine-grained column embeddings: Capturing detailed column context.
  3. Coarse-grained row-guided [CLS] embedding: A summary representation influenced by rows.
  4. Coarse-grained column-guided [CLS] embedding: A summary representation influenced by columns.

These features are then fed into a new ranking model called miniBERT, which uses Transformer blocks to learn cross-matching signals between these embeddings, enabling it to handle complex relationships between table elements.

Datasets

The paper evaluates StruBERT on three datasets:

  • WikiTables: A large corpus of tables from Wikipedia, used for keyword-based table retrieval and table similarity.
  • PMC (PubMed Central): A dataset focused on biomedical literature, used for table similarity.
  • Query by Example Dataset: A dataset derived from Wikipedia tables, used for content-based table retrieval.

The authors note that they adapt existing datasets for their specific tasks, rather than introducing entirely new benchmarks.

Key Insights and Ideas

  • The Synergy of Structure and Text: The most significant insight is that effectively combining textual metadata with the inherent row and column structure of a table is paramount for accurate table search and matching. Treating them independently leaves valuable information on the table (pun intended!).
  • Horizontal Self-Attention is Crucial: The introduction of horizontal self-attention, complementing vertical self-attention, allows the model to treat both dimensions of a table equally. This symmetrical approach is key to capturing richer contextual representations.
  • Many-to-Many Matching is Key: Unlike simpler matching strategies, StruBERT's miniBERT ranking model, leveraging Transformer's self-attention, excels at capturing complex "many-to-many" relationships between table elements (e.g., one column in table A might correspond to multiple columns in table B).
  • Coarse and Fine-Grained Features Complement Each Other: Using both detailed (fine-grained) and summary (coarse-grained) features leads to superior performance compared to using either alone, suggesting that different levels of abstraction are beneficial for different aspects of table understanding.

Key Results

StruBERT consistently outperforms state-of-the-art baselines across all three evaluated tasks:

  • Table Similarity: Achieved near-perfect accuracy (0.9942) on the WikiTables dataset and significant improvements on the PMC dataset.
  • Content-based Table Retrieval: Showed up to a 7.96% improvement in NDCG@5 over TaBERT, demonstrating its effectiveness in finding similar tables.
  • Keyword-based Table Retrieval: Outperformed existing methods on the WikiTables dataset, highlighting its ability to match keyword queries to relevant tables.

Ablation studies confirmed that combining fine- and coarse-grained features yields the best results, and that the miniBERT ranking model is more effective than other common ranking approaches when used with StruBERT features.

Limitations and Future Work

  • Pretraining of Horizontal Self-Attention: The authors acknowledge that the horizontal self-attention module was randomly initialized due to computational constraints. They hypothesize that pretraining this module on a task like "Masked Row Prediction" (analogous to TaBERT's "Masked Column Prediction") could further boost performance.
  • Computational Resources: The paper mentions that using larger BERT models (BERT-large-cased) was not feasible for all experiments due to computational limitations, suggesting potential for further gains with more resources.
  • Generalization: While the paper demonstrates generalization across different datasets and tasks, further exploration of its performance on more diverse table structures and domains could be beneficial.

The authors suggest pretraining the horizontal self-attention as a promising future direction.

Summary updated

Abstract

A table is composed of data values that are organized in rows and columns providing implicit structural information. A table is usually accompanied by secondary information such as the caption, page title, etc., that form the textual information. Understanding the connection between the textual and structural information is an important, yet neglected aspect in table retrieval, as previous methods treat each source of information independently. In this paper, we propose StruBERT, a structure-aware BERT model that fuses the textual and structural information of a data table to produce context-aware representations for both textual and tabular content of a data table. We introduce the concept of horizontal self-attention, which extends the idea of vertical self-attention introduced in TaBERT and allows us to treat both dimensions of a table equally. StruBERT features are integrated in a new end-to-end neural ranking model to solve three table-related downstream tasks: keyword- and content-based table retrieval, and table similarity. We evaluate our approach using three datasets, and we demonstrate substantial improvements in terms of retrieval and classification metrics over state-of-the-art methods.
BibTeX
@inproceedings{trabelsi2022strubert,
  author = {Mohamed Trabelsi and Zhiyu Chen and Shuo Zhang and Brian D. Davison and Jeff Heflin},
  title = {{StruBERT: Structure-aware BERT for Table Search and Matching}},
  booktitle = {Proceedings of the ACM Web Conference},
  year = {2022},
  doi = {10.1145/3485447.3511972},
}
Figure