Skip to main content
QUICK REVIEW

[论文解读] NFLAT: Non-Flat-Lattice Transformer for Chinese Named Entity Recognition

Shuang Wu, Xiaoning Song|arXiv (Cornell University)|May 12, 2022
Topic ModelingComputer Science被引用 19
一句话总结

该论文提出NFLAT,一种用于中文命名实体识别的非平面网格Transformer架构,通过使用InterFormer模块将词典融合与上下文编码解耦,降低了计算和内存开销。通过采用相对位置编码和辅助<non_word>标记,NFLAT在内存使用量比FLAT减少50%的情况下实现了最先进性能,从而实现了对大规模词典和预训练模型(如BERT)的高效利用。

ABSTRACT

Recently, Flat-LAttice Transformer (FLAT) has achieved great success in Chinese Named Entity Recognition (NER). FLAT performs lexical enhancement by constructing flat lattices, which mitigates the difficulties posed by blurred word boundaries and the lack of word semantics. In FLAT, the positions of starting and ending characters are used to connect a matching word. However, this method is likely to match more words when dealing with long texts, resulting in long input sequences. Therefore, it significantly increases the memory and computational costs of the self-attention module. To deal with this issue, we advocate a novel lexical enhancement method, InterFormer, that effectively reduces the amount of computational and memory costs by constructing non-flat lattices. Furthermore, with InterFormer as the backbone, we implement NFLAT for Chinese NER. NFLAT decouples lexicon fusion and context feature encoding. Compared with FLAT, it reduces unnecessary attention calculations in "word-character" and "word-word". This reduces the memory usage by about 50% and can use more extensive lexicons or higher batches for network training. The experimental results obtained on several well-known benchmarks demonstrate the superiority of the proposed method over the state-of-the-art hybrid (character-word) models.

研究动机与目标

  • 解决FLAT等平面网格方法在中文命名实体识别中计算和内存开销高的问题。
  • 减少词级别分词导致的序列长度膨胀问题,以实现词典增强。
  • 通过将词典融合与上下文编码解耦,提升效率和可扩展性。
  • 实现在中文命名实体识别中对大规模词典和预训练模型(如BERT)的有效利用。
  • 开发一种灵活、模块化的注意力机制(InterFormer),用于联合建模字符和词序列。

提出的方法

  • 提出InterFormer,一种新颖的注意力机制,通过相对位置编码对不同长度的两组序列之间的关系进行建模。
  • 引入非平面网格结构,通过不展开所有字符-词对,避免了FLAT中出现的序列长度爆炸问题。
  • 使用辅助<non_word>标记,通过引导模型聚焦于有效的词-字符对,抑制噪声注意力。
  • 将NER流程解耦为两个阶段:通过InterFormer进行词典融合,通过标准Transformer层进行上下文编码。
  • 在跨注意力中使用相对位置编码,以保留词边界信息并改善字符与词之间的对齐效果。
  • 通过替换嵌入层,与BERT-wwm等预训练模型集成,实现上下文特征与词典特征的联合利用。

实验结果

研究问题

  • RQ1非平面网格架构是否能在不损失性能的前提下,降低中文命名实体识别中词典增强的内存和计算成本?
  • RQ2与标准交叉注意力相比,带有相对位置编码的跨注意力在词边界检测方面有何改进?
  • RQ3<non_word>辅助标记在词-字符对齐过程中的注意力机制中,能在多大程度上减少噪声?
  • RQ4NFLAT能否有效扩展至更大规模的词典和预训练模型(如BERT)?
  • RQ5词典融合与上下文编码的解耦在提升训练效率和模型性能方面有何作用?

主要发现

  • NFLAT通过避免在网格中完全展开序列,相比FLAT将内存使用量减少了约50%。
  • 在MSRA基准上,NFLAT在使用BERT+CRF时达到96.40%的F1,优于BERT+CRF(80.14% F1)和FLAT(94.12% F1)。
  • 在TX词典下,NFLAT在MSRA数据集上达到82.78%的F1,超过Lattice-LSTM和CGN。
  • 消融实验表明,若移除相对位置编码,MSRA上的性能降至93.03% F1,表明其在边界感知中的重要性。
  • 若移除<non_word>标记,MSRA上的性能下降至93.66% F1,证实其在抑制噪声注意力方面的作用。
  • NFLAT在多个基准(Weibo、Resume、Ontonotes、MSRA)上均保持优异性能,展现出强鲁棒性和泛化能力。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。