数据增强
在自然语言处理中的数据增强方法主要可以分为三种:Paraphrasing, Noising, Sampling.
Paraphrasing:对句子中的词、短语、句子结构做一些更改,保留原始的语义
Noising:在保证label不变的同时,增加一些离散或连续的噪声,对语义的影响不大
Sampling:旨在根据目前的数据分布选取新的样本,会生成更多样的数据
各种方式的具体增强方法图如下:
Paraphrasing
这类方法根据替换的成分不同,又可以分为词、短语、句子级别。
Thesaurus:
利用词典、知识图谱等外部数据,随机将非停用词替换成同义词或上位词,如果增加多样性的话还可以替换成相同词性的其他词。
Advantage(s):
- Easy to use.
Limitation(s):
-
The scope and part of speech of augmented words are limited.
-
This method cannot resolve the ambiguity problem.
-
Sentence semantics may be affffected if there are too many substitutions.
Semantic Embeddings:
利用语义向量,将词或短语替换成相近的(不一定是同义词)。由于每个词都有语义表示,可替换的范围更大。而上一种方法只能替换图谱里的。
Advantage(s):
-
Easy to use.
-
Higher replacement hit rate and more comprehensive replacement range.
Limitation(s):
-
This method cannot resolve the ambiguity problem.
-
Sentence semantics may be affffected if there are too many substitutions.
MLMs
利用BERT等模型,随机mask掉一些成分后生成新的
Advantage(s):
-
This approach alleviates the ambiguity problem.
-
This method considers context semantics.
Limitation(s):
-
Still limited to the word level.
-
Sentence semantics may be affffected if there are too many substitutions.
Rules
利用一些规则,例如缩写、动词变位、否定等,对句子一些成分进行改写,比如把 is not 变成 isn’t
Advantage(s):
-
Easy to use.
-
This method preserves the original sentence semantics.
Limitation(s):
-
This method requires artifificial heuristics.
-
Low coverage and limited variation.
Machine Translation
分为两种,Back-translation指把句子翻译成其他语言再翻译回来,Unidirectional Translation指在跨语言任务中,把句子翻译成其他语言
-
Easy to use.
-
Wide range of applications.
-
This approach guarantees correct syntax and unchanged semantics.
Limitation(s):
- Poor controllability and limited diversity because of the fifixed machine translation models.
Model Generation
利用Seq2Seq模型生成语义一致的句子
-
Wide range of applications.
-
Strong application.
Limitation(s):
-
Require for training data.
-
High training diffiffifficulty.
Noising
人在读文本时对噪声是免疫的,比如单词乱序、错别字等。基于这个思想,可以给数据增加些噪声来提升模型鲁棒性。
- Swapping:除了交换词之外,在分类任务中也可以交换instance或者sentence
- Deletion:可以根据tf-idf等词的重要程度进行删除
- Insertion:可以把同义词随机插入句子中
- Substitution:把一些词随机替换成其他词(非同义),模拟misspelling的场景。为了避免改变label,可以使用label-independent的词,或者利用训练数据中的其他句子
- Mixup:这个方法最近两年比较火,把句子表示和标签分别以一定权重融合,引入连续噪声,可以生成不同label之间的数据,但可解释性较差
Sampling
Sampling是指从数据分布中采样出新的样本,不同于较通用的paraphrasing,采样更依赖任务,需要在保证数据可靠性的同时增加更多多样性,比前两个数据增强方法更难。作者整理了4种方法:
- Rules:用规则定义新的样本和label,比如把句子中的主谓进行变换
- Seq2Seq Models:根据输入和label生成新的句子,比如在NLI任务中,有研究者先为每个label(entailment,contradiction,neutral)训一个生成模型,再给定新的句子,生成对应label的。对比之下,paraphrasing主要是根据当前训练样本进行复述
- Language Models:给定label,利用语言模型生成样本,有点像前阵子看的谷歌UDG。有些研究会加个判别模型过滤
ntradiction,neutral)训一个生成模型,再给定新的句子,生成对应label的。对比之下,paraphrasing主要是根据当前训练样本进行复述 - Language Models:给定label,利用语言模型生成样本,有点像前阵子看的谷歌UDG。有些研究会加个判别模型过滤
- Self-training:先有监督训练一个模型,再给无监督数据打一些标签,有点蒸馏的感觉