jiesutd / YEDDA

YEDDA: A Lightweight Collaborative Text Span Annotation Tool. Code for ACL 2018 Best Demo Paper Nomination.
Apache License 2.0
1.02k stars 297 forks source link

怎么样将标注后的文件转换一下格式 #6

Closed 2like closed 6 years ago

2like commented 6 years ago

如何转换成下面的格式?谢谢! B-TIME I-TIME O O B-ORG I-ORG O O O O O O O O O O O O O O O O O O O O O O O O O O O

jinangela commented 6 years ago

@2like

Besides, another flag self.tagScheme controls the exporting format, the exported ".anns" will use the BMES format if this flag is set to "BMES", otherwise the exported file is formatted as "BIO".

你把YEDDA_Annotator.py里面的self.tagScheme设为BIO,.anns文件就变成BIO格式啦

jiesutd commented 6 years ago

多谢jinangela帮忙回复。

  1. 是的 self.tagScheme控制着export的格式(BIO 或者BMES)
  2. 注意一点就是对于export 时(分过词的中文或者英文)和未分词的中文有不一样的设置,前面两个是基于词的,后面未分词的是基于字的。对于未分词的数据,export时应该把下面的设置为False https://github.com/jiesutd/YEDDA/blob/c026d5c190a552c747f550732e2b92597bd4f40c/YEDDA_Annotator.py#L63
papioyyx commented 5 years ago

你好,我在更改self.tagScheme为BIO之后进行标注,发现格式是 美 B-LOC 国 B-LOC 的 O 华 B-PER 莱 B-PER 士 B-PER 这种形式的,请问如何能够自动标注为 B-LOC E-LOC O B-PER I-PER E-PER

jiesutd commented 5 years ago

@papioyyx 你这个导出的格式不太对,这也不是BIO的格式。下面这种才是BIO格式。 我有个脚本可以转换https://github.com/jiesutd/NCRFpp/blob/master/utils/tagSchemeConverter.py

美 B-LOC 国 I-LOC 的 O 华 B-PER 莱 I-PER 士 I-PER

papioyyx commented 5 years ago

谢谢!解决了!么么!!

jiesutd commented 5 years ago

@papioyyx 其实你导出时可以直接设置 self.tagScheme=“BMES” 就行了。

Another flag self.tagScheme controls the exporting format, the exported ".anns" will use the BMES format if this flag is set to "BMES", otherwise the exported file is formatted as "BIO".

papioyyx commented 5 years ago

@jiesutd ,谢谢,是我操作上的问题!