syuoni / eznlp

Easy Natural Language Processing
Apache License 2.0
130 stars 21 forks source link

span-based 方法,为什么有些数据集是BIO类标签标注的? #46

Closed nlper01 closed 7 months ago

nlper01 commented 8 months ago

大佬,你好,有个问题,如题。span-based 方法,为什么有些数据集是BIO类标签标注的?比如Resume?

syuoni commented 8 months ago

模型采用 span-based 还是 sequence tagging 方法和数据集的标注格式是没关系的。数据无论采用 tags 标注,还是直接基于 span 标注,可以互相转化。

Resume 数据集是 BMES 标注,读取数据的代码在这里:https://github.com/syuoni/eznlp/blob/master/scripts/utils.py#L292-L296 。其中,ConllIO 内部通过一个 ChunksTagsTranslator 实例将 tags 序列转变成 chunks 集合(可以理解为 spans + 标签),参考:https://github.com/syuoni/eznlp/blob/master/eznlp/io/conll.py#L39