我想将IOB格式的文本文件转换为具有每个令牌的开始和结束索引的SpaCy格式。
我运行此代码:
python -m spacy convert test_IOB.txt out --converter jsonl --lang English
我有错误:
ValueError: Unexpected character found when decoding 'true'
我的输入数据如下:
the O
r O
/ O
p O
( O
years O
) O
ratio O
of O
the O
sand O
is O
16 O
. O
chiaramonte O
, O
l. O
2008 O
, O
geomechanical O
characterization O
and O
reservoir O
simulation O
of O
a O
co O
sequestration O
project O
in O
a O
mature O
ofield O
谢谢!
您正在调用--converter json
选项,但您的输入文件不是json
格式。
您应该使用--converter ner
作为输入。
ner
NER,带有IOB / IOB2标签,每行一个令牌,各列之间用空格隔开。第一列是令牌,最后一列是IOB标签。句子用空白行分隔,文档用-DOCSTART- -X-O O行分隔。支持CoNLL 2003 NER格式。 See sample data。