Press "Enter" to skip to content

序列标注的方法中有多种标注方式BIO、BIOSE、IOB、BILOU、BMEWO的异同

本站内容均来自兴趣收集,如不慎侵害的您的相关权益,请留言告知,我们将尽快删除.谢谢.

序列标注的方法中有多种标注方式:BIO、BIOSE、IOB、BILOU、BMEWO,其中前三种最为常见。各种标注方法大同小异,下面以命名实体识别为例,看一看他们之间的区别,主要关注标注方法对最终模型效果的影响。

 

结论写在前面:大多数情况下,直接用BIO就可以了; 大多数情况下BIO和BIOES的结果差不太多,文末展示了各个数据集上的结果。

 

1. BIO

 

B stands for ‘ beginning ‘ (signifies beginning of an Named Entity, i.e. NE)

 

I stands for ‘ inside ‘ (signifies that the word is inside an NE)

 

O stands for ‘ outside ‘ (signifies that the word is just a regular word outside of an NE)

 

2. BIOES

 

B stands for ‘ beginning ‘ (signifies beginning of an NE)

 

I stands for ‘ inside ‘ (signifies that the word is inside an NE)

 

O stands for ‘ outside ‘ (signifies that the word is just a regular word outside of an NE)

 

E stands for ‘ end ‘ (signifies that the word is the end of an NE)

 

S stands for ‘ singleton ‘(signifies that the single word is an NE )

 

3.  IOB (即IOB-1)

 

IOB与BIO字母对应的含义相同,其不同点是IOB中,标签B 仅用于 两个连续的同类型命名实体的边界区分,不用于命名实体的起始位置,这里举个例子:

 

词序列:(word)(word)(word)(word)(word)(word)

 

IOB标注:(I-loc)(I-loc)(B-loc)(I-loc)(o)(o)

 

BIO标注:(B-loc)(I-loc)(B-loc)(I-loc)(o)(o)

 

The IOB scheme is similar to the BIO scheme,however, here the tag B- is only used to start a segment if the previous token is of the same class but is not part of the segment.

 

因为IOB的整体效果不好,所以出现了IOB-2,约定了所有命名实体均以B tag开头。这样IOB-2就与BIO的标注方式等价了。

 

4. BILOU (等价于 BIOES)

 

B stands for ‘ beginning ‘ (signifies beginning of an NE)

 

I stands for ‘ inside ‘ (signifies that the word is inside an NE)

 

O stands for ‘ outside ‘ (signifies that the word is just a regular word outside of an NE)

 

L stands for ‘ last ‘ (signifies that the last word of an NE)

 

U stands for ‘ unit ‘(signifies that the single word is an NE )

 

5. BMEWO (等价于 BIOES)

 

B stands for ‘ beginning ‘ (signifies beginning of an NE)

 

M stands for ‘ middle ‘ (signifies that the word is inside an NE)

 

O stands for ‘ outside ‘ (signifies that the word is just a regular word outside of an NE)

 

E stands for ‘ end ‘ (signifies that the word is the end of an NE)

 

W stands for ‘ whole ‘(signifies that the whole word is an NE )

 

综上,诸多主流的序列标注方法本质上就有3种,BIO,IOB,IBOES,这里简单分析一下:

 

 

IOB因为缺少B-tag作为实体标注的头部表示,丢失了部分标注信息,导致很多任务上的效果不佳

 

BIO解决了IOB的问题,所以整体效果优于IOB

 

BIOES额外提供了End的信息,并给出了单个词汇的S-tag,提供了更多的信息,可能效果更优,但其需要预测的标签更多(多了E和S),效果也可能受到影响。

 

 

下面来看一下各个标注方法的效果比较:

 

先来看一下数据集,都是比较经典的序列标注数据集,第一列是任务类型:

 

 

接下来看一下各个标注方法的效果(这些数字均为多次实验采样的结果):

 

 

结论:

 

 

可以看到IOB表现很糟糕,BIO和BIOES各有优劣,网上也有一些小伙伴反馈说:BIO和BIOES在很多任务上的表现差异不大,可能是小数点后3-4位的差别。

 

所有上述结果均为英文数据集上的结果,中文数据上暂无对比结果。

 

 

基于BIOES这个标注格式,衍生出了更加复杂的标注方法, 明确了命名实体边界的边界,比如: BMEWO+(There is also BMEWO+, which put more information about surrounding word class to Outside tokens (thus “O plus”))这里给出一个图表以示区别:

 

 

BMEWO+标注方法的效果方面有待检验。感兴趣的小伙伴可关注一下Ref 2,在文章中还给出了多种标注方法的复杂度分析。

 

Reference

 

1. Optimal Hyperparameters for Deep LSTM-Networks for SequenceLabeling Tasks

 

2. Coding Chunkers as Taggers: IO, BIO, BMEWO, and BMEWO+

 

3. 中文命名实体识别的 github repo

Be First to Comment

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注