{'fraction_non_alphanumeric': 0.03339752685992297, 'fraction_numerical': 0.0034968578958037705, 'mean_word_length': 4.533651149747616, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Active Learning with Tabular Language Models

Despite recent advancements in tabular language model research, real-world applications are still challenging. In industry, there is an abundance of tables found in spreadsheets, but acquisition of substantial amounts of labels is expensive, since only experts can annotate the often highly technical and domain-specific tables. Active learning could potentially reduce labeling costs, however, so far there are no works related to active learning in conjunction with tabular language models. In this paper we investigate different acquisition functions in a real-world industrial tabular language model use case for sub-cell named entity recognition. Our results show that cell-level acquisition functions with built-in diversity can significantly reduce the labeling effort, while enforced table diversity is detrimental. We further see open fundamental questions concerning computational efficiency and the perspective of human annotators.


Introduction
Recent tabular language models (TaLMs) which are based on pre-trained transformers and modalityadapted to tabular data have shown promising results on academic datasets [3]. However, using pre-trained transformer models for complex tasks in industry still requires fine-tuning with substantial amounts of labels. Although tabular data in spreadsheets is ubiquitous in industry, the application of TaLMs in real-world settings is still marginal. One reason is that acquiring labels for industrial spreadsheets, e.g. cell-level entity or column annotations, quickly becomes prohibitively expensive considering that often highly technical and domain specific language can only be annotated by a handful of experts.
Settings with abundant unlabeled data and costly label acquisition are perfect matches for active learning (AL), which aims to minimize the costs of acquiring labeled data by maximizing model's performance with each new labeled instance. Deep neural networks, such as large-scale transformers, require batch-based acquisition functions instead of classical one-by-one instance selection, since these large models need to be trained for multiple epochs on batches of labeled data to effectively change the model's parameters for the next iteration of candidate acquisition. Otherwise training is inefficient and can lead to overfitting [7]. A popular approach here is to have hybrid acquisition functions that weigh instance-wise uncertainty against some within-batch similarity (diversity) of all instances [11].
In the text data modality, batch typically means a set of sentences or documents. Even for a given token-level task such as named entity recognition (NER), we still want to select the most informative sentences (not single tokens), since all NER labels depend on the full sentence context. In AL terms, NER is a so-called multi-instance problem [10]. Transferring this to tabular data, a batch therefore should be a set of tables. Given a cell-level task, where each cell may have multiple labels, this is now a nested multi-instance problem. Since the instance is the full table, each table has multiple  cells and cells have multiple labels. Until now, the table modality for AL has not been explored and it is unclear how to deal with such a novel AL problem. In this paper, we study how well-known AL  acquisition functions can be adopted to TaLMs to solve an industrial sub-cell NER task where named entities are mentioned in tables cells.
Our key contributions are the following: • We present an industrial NER use case for TaLMs in conjunction with AL. • We outline novel problems that arise with AL when dealing with tabular data. • We adopt well-known AL acquisition functions to tables and carry out an empirical evaluation on a real-world industrial dataset.

Industrial Table NER Use Case
Our use case originates from the need for information extraction to support data management in the process industry. Industrial plant operators have to maintain data about plant equipment, such as actuators, sensors, vessels, etc., processes, and ingredients among others. This data is used, for example, for process monitoring, maintenance, or other regulatory reasons. Typically, still today such data is collected and maintained by engineers in some form of spreadsheets. The spreadsheets are roughly organized in a tabular format, as shown in the example table in Figure 1. In these spreadsheets, each row typically represents information about one or multiple equipment instances. Some columns represent relevant physical properties of these equipment, while others are non-informative. However, the engineers do neither comply to a fixed schema, nor to unified spelling of equipment or properties. The NER task is to automatically extract relevant entities for creating structured specifications of the plant equipment. We phrase this problem as NER task (sub-cell NER) with the following types of entities. The type TAG refers to a systematic identifier of an equipment. There are some conventions for generating equipment tags, but most plant operators customize them and some sheets do not contain identifiers at all. Type EQ is for surface names of equipment types. The type QUANT refers to the physical properties/quantities describing the functional specifications of equipment and the type UoM stands for unit of measurement.
As these tables can get quite large, e.g. hundreds of rows, labeling all cells in a single table is already too time-consuming for human annotators. However, table cells can contain lots of similar, repetitive content, where it may be enough to provide small amount of labels to reach good performance. Therefore, we are interested in AL acquisition functions that would select the most informative instances to be labeled, but it is unclear on which level (token, cell, table) to select instances, as shown in the bottom of Figure 1.

AL and TaLMs
In this section we give a general introduction of AL and define our TaLM for sub-cell NER.
Given an unlabeled dataset X U ∼ P sampled from some true unknown distribution P. The objective of pool-based AL is to select candidates X S ⊂ X U to be labeled with restricted budget m ≥ |X S | and m |X U | such that: arg min where y is the corresponding label of instance x, (·) is a loss function and f θ is a classification model trained on data X S with revealed labels from an oracle. Finding the optimal candidate set X S w.r.t. 1 is infeasible since in AL by definition we do not have access the true distribution nor any labels (except for a small seed set). However, based on principles such as uncertainty sampling AL research has proposed several heuristics to address this problem. These heuristics are often called query strategies or acquisition functions f acq (x u ; f θ ) : X U → R assigning a score to every instance based on the current classification model f θ . Typically, AL is performed in an iterative fashion where candidates in the next iteration are sampled considering the model trained on the previous candidates.
In our case f θ is a TaLM and X U consists of a set of tables. We define a table as a tuple T = . . , c n,m } is the set of table body cells for n rows and m columns. Every cell c i,j = w ci,j ,1 , w ci,j ,2 , . . . , w ci,j ,t is a sequence of tokens of length t. The table header H = {h 1 , h 2 , . . . , h m } is the set of corresponding m column header cells, where h j = w hj ,1 , w hj ,2 , . . . , w hj ,t is a sequence of header tokens.
Our TaLM consists of an encoder which will produce a table context-sensitive representation for each token: w h1,1 , . . . , w hm,t , w c1,1,1 , . . . , w cn,m,t = ENC(T ), where ENC is a table-biased transformer encoder using the row-column visibility matrix instead of vanilla attention and only within-cell positional encoding, refer to [6] for a more detailed description of this architecture. Note that most TaLM architectures like TURL [2] are not directly applicable here, since they already aggregate tokens within cells to get cell-level representations. This is why we resort to this TaLM based on a pre-trained language model and modality adapt it to tables while fine-tuning for the sub-cell NER task.
Each labeled cell has an NER-tag sequence: (y 1 , y 2 , . . . , y t ), where each y i ∈ Y. We use IO tags, thus Y is {O} ∪ {I-ENT}, where ENT ∈ {TAG, EQ, QUANT, UoM}. Our TaLM decoder DEC is a classification layer that projects each token representation into the label space, plus a Softmax activation to assign a normalized score for each class.
whereŷ i,j,z is the probability distribution of the labels of the z-th token in header or body cell i, j.

Table NER Acquisition Function
As mentioned above, AL is primarily concerned with the choice of an acquisition function. This function assigns a score to each instance, thereby determining which new (unlabeled) instances to select for labeling such that they maximize the informativeness to the current model.
For single-instance tasks, such as text classification, the design of acquisition functions is straightforward -every instance has one label -so select the instance x with the most informative label distributionŷ. For example, the popular entropy-based f ent acq (x U ; f θ ) = H [ŷ | x U ; f θ ], simply ranks every x U based on the entropy H of the label distribution.
In multi-instance tasks such as NER there might be multiple labels (entity spans) in a single sentence instance. Therefore, we want to select the instance x U where the acquisition function considers the joint label distributionsŷ 1 ,ŷ 2 , . . . ,ŷ t . In our table NER case, we have a nested multi-instance problem. Every table instance T k has multiple cells, for example body cells c k,i,j , and every such cell has a sequence of label distributions (ŷ k,i,j,1 ,ŷ k,i,j,2 , . . .ŷ k,i,j,t ) associated with the t tokens in the cell.
One could argue that in our table NER case, the acquisition function should select whole tables with most informative set of cells. Unfortunately, it is not reasonable to assume that a human annotator would have the time to annotate every cell in a full table. Hence, since a single table would already break the annotation budget, we need an acquisition function on cell-level. One possibility is to do this hierarchically: first select a set of tables using f acq (T ; f θ ) (e.g. by clustering table representations), then from this set of tables select a set of cells f acq (c i,j ; f θ ) (e.g. by well-known multi-instance acquisition functions).
On the other hand, note that in our TaLM for NER f θ (T ) all cells c i,j in table T are informed and therefore depend on each other. Based on this we argue that an acquisition function f acq (c i,j ; f θ ) on cell-level is enough since it already captures the context of the full table T . In the following we adopt common acquisition functions to select batches of most informative cells. We consider different types of acquisition functions in our experiments -pure uncertainty-based, real-world diversity and batch diversity.
MNLP A popular acquisition function for uncertainty-sampling in multi-instance problems is the maximized normalized log-probability (MNLP) [9]. It considers the probability of the model's most likely label sequence to select new instances (here cells) c i,j with mean normalization to account for the bias towards longer sequences. Since the most likely label sequence in our TaLM is simply the sequence of every most likely token label we have: where y * i,j,z is the probability of the class with the maximum probability in the predicted label distribution. The sums of log-probabilities are negative, hence the candidates are selected in ascending order w.r.t. to 4. MNLP has a major weakness in the batch-based AL setting. The sequences with highest uncertainty for the current model tend to be highly correlated. Therefore, when selecting a batch of candidates, there will be substantial similarity within the batch, providing little additional value. For tables this means that most candidates will likely come from the same table or even the same row/column. MNLP+ To make MNLP less prone to selection of similar cells, we introduce a simple procedure considering real-world diversity in the tables. Instead of selecting the cells with the highest uncertainty from the set of all tables, we first sort all cells within every table w.r.t. to 4. Then we employ a round-robin selection across tables by taking the current table's best available candidate cell and moving to the next table until the budget is empty. In other words, this acquisition is a combination of cell uncertainty with a maximum table-diversity constraint.
BADGE As a batch-diverse acquisition function we consider Batch Active learning by Diverse Gradient Embeddings (BADGE) [1]. Here, the authors propose to measure uncertainty in the magnitude of the model's last layer gradients. A diverse set of candidates is then selected using the k-MEANS++ initialization to sample from the gradient embeddings. In our case, we take the mean of each cell's token gradient embeddings and feed this into k-MEANS++ to get cell candidates: where g i,j,z = ∂ ∂θ out CE (ŷ i,j,z , y * i,j,z ) is the gradient of the cross-entropy loss CE of the z-th token label distribution and its predicted maximum label y * i,j,z w.r.t. the decoder classification layer weights θ out .
Rand As a simple baseline we also employ an acquisition function that selects candidate cells uniformly at random from the set of all cells in all available tables.

Experiments
In this section we describe the experiments on our real-world industrial dataset.
Dataset The dataset contains spreadsheets from multiple industrial plants. The rows in the original sheets were downsampled, such that each resulting table had a maximum of 5 rows. Expert annotators were then asked to label each table cell-by-cell using the prodi.gy span-based NER annotation tool. After performing a random train-test split, we end up with 55 tables in the training set and 24 in the test set. The training set statistics are shown in Table 1. We can see that in total they contain ∼ 1,1k NER span labels. Dividing this by the number of cells in all tables, we observe that the vast majority ∼ 77% of cells are only comprised of tokens with label O. This is an extreme class-imbalancetypical for industry settings. Note that Figure 1 is not representative of all tables, i.e. there are some with much less densely populated NER labels.
AL Setup For every AL acquisition function, a single experiment starts with a set of 100 labeled cell candidates X L as seed to initially train our NER TaLM (iteration 0). Since tasks with high class-imbalance have strong dependence on this initial seed, we make sure that it is stratified w.r.t. the class distribution in the overall training set. This should mitigate the risk of completely missing minority classes in the initial seed. After seed selection, the AL acquisition function selects a batch X S of 50 unlabeled instances (cells) from X U that are added to X L along with their true labels in each iteration. Following the suggested protocol from [4], we fine-tune in each iteration from scratch to avoid overfitting data from previous rounds. In each iteration we train for a maximum of 30 epochs and use a small portion of the test set as validation for early stopping. In each experiment, all acquisition functions start with the same initial seed. The reported results are the average over 5 different experiments, i.e., 5 different initial seeds. As pre-trained language model we use the 'bert-base-uncased' from huggingface.
After every experiment we evaluate the model's final performance against the hold-out test set. As a ceiling benchmark we also train our NER TaLM on the full training dataset. As performance metric we chose the micro-averaged F1-score.

Results and Discussion
The test set performance throughout iterations is shown in Figure 2a. BADGE is the only acquisition function that clearly outperforms Rand and even exceeds full training performance. Interestingly, MNLP has only slight advantages over Rand after around 500 labels. MNLP+ is by far the worst meaning that the forced maximum table diversity is too extreme and detrimental to performance. We also notice higher variance for MNLP which suggests that it is more dependent on the initial seed labels, which is a known issue in these high-imbalance settings [10]. BADGE also seems to alleviate this problem to some degree looking more robust across different seeds.
In terms of diversity of samples we show the number of different tables from which each acquisition function selects cells in each iteration in Figure 2b. This metric shows that MNLP suffers from selecting similar cells from the same table with only slightly increasing number of tables. MNLP+ is by design selecting from as many tables as the budget allows. Random sampling only samples from roughly half the tables. This is due to an imbalance in table sizes -some large ones dominating the uniform sampling procedure. BADGE seems to strike a good balance between table diversity and cell uncertainty, sitting between MNLP and Rand in the number of tables. Also note that the full training performance is lower compared to the original work [6], since we do not use data augmentation here. Although combining AL with data augmentation looks like a promising direction [5].
Computational Efficiency Apart from pure classification performance, we may also consider computational efficiency. As an example, in a cell-level task, an acquisition function that retrieves a set of k candidate cells from a single table versus k cells which span over k tables (one cell per table) will perform much fewer computations. Especially, for large tables we may want our acquisition to balance the informativeness of instances versus the number of tables that fit in a batch compute budget. Alternatively, we want the acquisition to select the most informative sub-tables rows (context), such that large tables will not impact the compute limits too much. Since TaLMs have a high memory footprint, a very table-diverse acquisition function may be much more expensive than others.
Human Annotators On the other hand, a table-diverse acquisition function may also impact human annotators. When presented with many different tables, the annotator probably needs more time per cell annotation, because every table's unique schema and context needs to be interpreted. This again raises the question if the full table needs to be shown to the user to make an informed labeling decision or a sub-table is sufficient.

Related Work
Pre-trained large-scale language models like BERT have been studied in AL setups for different tasks, e.g. text classification [8]. While these models can already show good results when fine-tuning on small labeled datasets, in industry AL is still often necessary as argued in [4], where an empirical study of AL for BERT in text classification was carried out. They consider the challenging, practical scenario with high class-imbalance and small annotation budget. Their results show that batch-diverse acquisitions handle this scenario better than classical ones.
For NER deep conditional random field models have been studied with AL [9] with the focus on computational efficiency, due to expensive training. Further the missed-class effect due to the AL's exploitative acquisition has been studied in NER [10]. The authors propose acquisitions for more informed seed instance selection that can alleviate this problem.
While all of these works are relevant to ours, it is non-trivial to transfer their findings to AL on tables using TaLMs.