标题:《DIET: Lightweight Language Understanding for Dialogue Systems》
中文:用于对话系统的轻量语言理解方法
时间:2020年5月
作者:RASA
简介:这个是RASA团队针对对话系统中NLU任务,设计的一种新框架,名叫Dual Intent and Entity Transformer (DIET,双重意图与实体Transformer ) 。成果是,DIET在不利用pre-trained embeddings.的情况下,达到了可比的性能,即large pre-trained models对NLU任务似乎没有什么优势。我们的方法比微调的BERT还好。
代码:https://github.com/RasaHQ/DIET-paper
Introduction
本文,我们提出DIET——一个用于意图分类和实体识别(intent classification and entity recognition)的多任务框架。考虑两方面的embeddings,一是pre-trained word embeddings from language
models,二是sparse word and character level n-gram features。我们的特点是有能力将两种特征以plug-and-play方式结合起来。实验显示,尽管不使用pre-trained embeddings, 仅使用sparse
word and character level n-gram features, DIET依然能超越SOTA的NLU性能。而在增加pre-trained embeddings和sentence embedding的情况下,性能可以进一步提升。我们的最好性能优于微调BERT,且速度是后者6倍。
Related Work
1 transfer learning
- fine-tuning a large pre-trained language model like BERT may not be optimal for every downstream task
- we study the impact of using sparse representations like word level one-hot encodings and character level n-grams along with dense representations transferred from large pre-trained language models.
2. Joint Intent Classification and Named Entity Recognition
以多任务学习的方式,联合实现意图分类与NER,这个思路已经有很多论文研究过。
本文中,我们利用一个 similar transformer-based的多任务设置用于DIET
。并通过消融实验与单任务设置下进行对比。
DIET Architecture
框架如图1所示,
Featurization
在每一个句子结尾加一个__CLS__
的special token。
每个token都有它的嵌入,可以是sparse的,可以是dense的。通过线性层统一维度。
Transformer
自己实现一个小型的(2层)的Transformer来编码context。
NER
用Transformer输出向量,接一个CRF层进行NER。
Intent Classification
over all possible intent labels,将label嵌入与CLS对应的隐藏向量计算dot-product similarity。
训练阶段:最大化正标签的相似度,最小化负标签的相似度
inference阶段:rank。
Masking
受masked language modelling task的启发,我们额外增加一个MASK损失函数来预测randomly masked input tokens.
Batching
- 使用balanced batching strategy来缓解class imbalalance:因为某些intent占比太少
- 在训练过程中增大batchsize,作为另一个source of regularization