目錄
序列標注的方法中有多種標注方式,其中最常見的標注方式是:BIO、BIOSE和IOB 。下面我們來介紹一下。
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)
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 )
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的標注方式等價了。
總結
- IOB因為缺少B-tag作為實體標注的頭部表示,丟失了部分標注信息,導致很多任務上的效果不佳
- BIO解決了IOB的問題,所以整體效果優於IOB
- BIOES額外提供了End的信息,並給出了單個詞匯的S-tag,提供了更多的信息,可能效果更優,但其需要預測的標簽更多(多了E和S),效果也可能受到影響。
下面來看一下各個標注方法的效果比較:
先來看一下數據集,都是比較經典的序列標注數據集,第一列是任務類型:
數據集介紹
接下來看一下各個標注方法的效果(這些數字均為多次實驗采樣的結果):
標注方法的效果比對
結論:
- 可以看到IOB表現很糟糕,大多數情況下,直接用BIO就可以了;
- BIO和BIOES各有優劣,網上也有一些小伙伴反饋說:BIO和BIOES在很多任務上的表現差異不大,可能是小數點后3-4位的差別。
- 所有上述結果均為英文數據集上的結果,中文數據上暫無對比結果。