Abstract

Complex Named Entity Recognition (NER) is the task of detecting linguistically complex named entities in low-context text. In this paper, we present ACLM (Attention-map aware keyword selection for Conditional Language Model fine-tuning), a novel data augmentation approach, based on conditional generation, to address the data scarcity problem in low-resource complex NER. ACLM alleviates the context-entity mismatch issue, a problem existing NER data augmentation techniques suffer from and often generates incoherent augmentations by placing complex named entities in the wrong context. ACLM builds on BART and is optimized on a novel text reconstruction or denoising task: we use selective masking (aided by attention maps) to retain the named entities and certain keywords in the input sentence that provide contextually relevant additional knowledge or hints about the named entities. Compared with other data augmentation strategies, ACLM can generate more diverse and coherent augmentations preserving the true word sense of complex entities in the sentence. We demonstrate the effectiveness of ACLM both qualitatively and quantitatively on monolingual, cross-lingual, and multilingual complex NER across various low-resource settings. ACLM outperforms all our neural baselines by a significant margin (1%-36%). In addition, we demonstrate the application of ACLM to other domains that suffer from data scarcity (e.g., biomedical). In practice, ACLM generates more effective and factual augmentations for these domains than prior methods.

The problem

Standard NER benchmarks such as CoNLL 2003 test “easy” proper-name entities in well-formed news text. Complex NER benchmarks like MultiCoNER instead contain short, low-context sentences with emerging and semantically ambiguous entities (movie titles in comments, product names, political groups). We found that a state-of-the-art NER model drops by 23% when moved from CoNLL 2003 to MultiCoNER, and by 31.8% in a low-resource setting with only 500 training samples.

Data augmentation is the usual remedy for scarce labels, but existing NER augmenters break down on complex entities. Swapping entities between sentences or replacing them with synonyms leads to context-entity mismatch (the name of a book dropped into a sentence about a movie), and fine-tuned language models struggle to invent new context around entities they have never seen. The resulting incoherent or non-factual augmentations hurt learning, especially in knowledge-sensitive domains such as biomedical NER.

Approach

ACLM reframes augmentation as conditional generation: keep the entities, keep the few words that explain them, and ask a denoising model to rewrite everything else. A sentence becomes a template through a four-step process:

  • Keyword selection. A XLM-RoBERTa NER model fine-tuned only on gold data provides attention maps. Summing attention over the last four layers, we pick the top p% of non-entity tokens that the entities attend to most, ignoring punctuation, stop words, and other entities.
  • Selective masking. Every non-entity token outside the keyword set is replaced by a mask token, and contiguous masks are collapsed.
  • Labelled sequence linearization. Label tokens are inserted before and after each entity so the model sees entity types and boundaries during fine-tuning and generation.
  • Dynamic masking. At every training and generation round, a masking rate sampled from a Gaussian hides a small, random subset of the keywords, which increases context and length diversity.

ACLM is built on mBART-50-large and fine-tuned to reconstruct the original sentence from its template, a selective version of the denoising objective BART is pre-trained on. At generation time, each training sentence is corrupted R times to produce R augmentations, with top-k sampling and beam search for diversity. Post-processing removes augmentations that are too similar to the original sentence and strips the label tokens, and the augmented data is concatenated with the gold data to fine-tune the NER model.

mixner adds a second source of diversity: during generation, the template of a sentence is concatenated with the template of a semantically similar sentence (retrieved with multilingual Sentence-BERT), so ACLM produces sentences that combine context and entities from both.

Gold sentence entities + labels low context 1. Keywords attention map of fine-tuned NER model: top p% of non-entity tokens attention map 2. Template mask all other tokens, add label tokens, dynamic keyword masking [M] enemy [M] guns + mixner template 3. mBART-50 fine-tuned to reconstruct the sentence, then generates R = 5 top-k sampling + beam search Augmented NER data gold + generated fine-tune NER
A gold sentence is reduced to its entities plus the keywords they attend to, everything else is masked, and mBART-50 is fine-tuned to fill the gaps; at generation time the same templates (optionally mixed with a similar sentence's template by mixner) yield new, coherent training sentences.

Example

The worked example from Figure 1 of the paper (MultiCoNER, English). Keywords selected from the attention map are enemy, infantry, retired, swarmed, hidden ground, attack; the only entity is royal artillery (GRP).

Input: gold sentence

he advanced, attacked the enemy’s infantry with the lance, and then retired while the enemy swarmed out of hidden ground where [royal artillery]GRP guns could attack them.

Template after selective masking and labelled sequence linearization

[M] enemy [M] infantry [M] retired [M] enemy swarmed [M] hidden ground [M]
<b-grp> royal <b-grp> <i-grp> artillery <i-grp> guns [M] attack [M]

Template after dynamic masking (a few keywords dropped)

[M] enemy [M] infantry [M] swarmed [M] hidden ground [M]
<b-grp> royal <b-grp> <i-grp> artillery <i-grp> guns [M]

Output: generated augmentations

  • the enemy’s infantry was attacked by [royal artillery]GRP guns.
  • the enemy’s infantry was swarmed to the ground with [royal artillery]GRP guns.
  • With mixner (template joined with that of the similar sentence “ashby was wounded in the right foot during one of three raids into [kentucky]LOC made by his regiment during 1862.”): ashby conducted raids across the line from [kentucky]LOC and the enemy were attacked and later retired by hidden ground [royal artillery]GRP guns.

A second example from Figure 3 compares augmenters on a sentence about a game studio, where entity swapping and random word replacement break either coherence or factuality:

Input: original sentence

it was developed by a team led by former [blizzard entertainment]CORP employees, some of whom had overseen the creation of the [diablo]CW series.

Output: augmentations by method

  • LwTR: it was developed by a makers led by, [blizzard entertainment]CORP ., some of whom had elevation the serving of the [diablo]CW 12th. (random word replacement makes the sentence incoherent)
  • MELM: it was developed by a team led by former [blizzago games]CORP employees, some of whom had overseen the creation of the [hablo]CW series. (coherent, but the new entities do not exist)
  • ACLM: [blizzard entertainment]CORP employees have overseen the production of the animated films, including the production of the [diablo]CW series.
  • ACLM + mixner: the team of the [blizzard entertainment]CORP had overseen the creation of the game [diablo]CW and many of its workers founded [pyro studios]CORP in the early 1960s.
Figure 3 of the paper: augmentations from LwTR, MELM, ACLM, and ACLM with mixner on a MultiCoNER sentence (top) and an NCBI Disease sentence (bottom), with the explanation of what each method gets right or wrong.

Results

All experiments use MultiCoNER across 10 languages (English, Bengali, Hindi, German, Spanish, Korean, Dutch, Russian, Turkish, Chinese) with 100, 200, 500, and 1000 gold training sentences, reporting micro-F1 averaged over 3 seeds. Baselines include Gold-Only, LwTR, DAGA, MulDA, and MELM.

Monolingual, average over 10 languages 100 gold 200 gold 500 gold 1000 gold
Gold-only 24.97 38.06 45.86 44.40
LwTR 36.68 40.98 47.07 51.19
DAGA 16.51 28.20 35.60 42.68
MELM 30.51 36.24 41.51 44.00
ACLM (ours) 39.47 45.74 49.72 53.74

Source: Table 1 of the paper (Avg column). Micro-F1 on the MultiCoNER test sets, averaged over the 10 languages and 3 seeds. Higher is better.

Cross-lingual, English source En to Hi En to Bn En to De En to Zh Avg
Gold-only (500) 35.93 25.64 50.13 7.23 29.73
LwTR (500) 43.14 34.60 51.61 11.40 35.19
MELM (500) 34.97 27.17 44.31 7.31 28.44
ACLM (500) 44.36 35.59 54.04 16.27 37.57

Source: Table 1 of the paper (right half), 500 gold English sentences, zero-shot evaluation on the target language. Higher is better.

Other domains, 500 gold CoNLL 2003 BC2GM NCBI Disease TDMSci Avg
Gold-Only 84.82 55.56 75.75 47.04 65.79
LwTR 85.08 60.46 78.97 60.74 71.31
DAGA 81.82 51.23 78.09 57.66 67.20
MELM 83.51 56.83 75.11 57.80 68.31
ACLM (ours) 84.26 62.37 80.57 61.77 72.24

Source: Table 4 of the paper. F1 on news (CoNLL 2003), biomedical (BC2GM, NCBI Disease), and science (TDMSci) NER with 500 gold sentences. Higher is better.

  • Monolingual complex NER: ACLM achieves the best result in every language and every low-resource setting, with absolute gains of 1.5%-22% over the neural baselines MELM and DAGA.
  • Multilingual complex NER: in the combined 10-language setting ACLM averages 51.40 / 53.45 / 55.90 / 58.27 F1 at 100 / 200 / 500 / 1000 sentences per language, versus 46.86 / 51.42 / 53.66 / 57.78 for Gold-Only (Table 2).
  • Generation quality: at 500 gold sentences ACLM has the lowest GPT-2 perplexity of the compared augmenters (57.68 vs. 82.31 for MELM and 129.35 for LwTR) and the highest non-entity diversity (41.16 vs. 0.0 and 16.22) and length diversity (5.82 vs. 0.0 and 0.0) (Table 3).
  • Other domains: ACLM has the best average F1 at both 200 (67.93) and 500 (72.24) gold sentences, and the best score on every dataset except CoNLL 2003 at 500, where LwTR leads.

MultiCoNER at a glance

Sentences English Hindi Bengali Chinese Multi (11 languages)
Train 15,300 15,300 15,300 15,300 168,300
Dev 800 800 800 800 8,800
Test 217,818 141,565 133,119 151,661 471,911

Source: Table 12 of the paper. Six entity classes: PER, LOC, GRP, CORP, CW (creative work), PROD. The low-resource experiments sample 100-1000 sentences from each training split.

Resources

Quick start

From the repository README: install the requirements, then run the training script with the language, dataset size, seed, masking rate, and number of generations.

pip install -r requirements.txt
cd ./src
# sh train_dynamic_multilingual.sh <language> <language label> <size of dataset> <flair batch size> <seed> <masking rate> <number of generations>
sh train_dynamic_multilingual.sh zh zh_CN 100 8 42 0.3 5
# with mixner
sh train_dynamic_multilingual_mixner.sh zh zh_CN 100 8 42 0.3 5