提交 a6f52829 编写于 作者: L LDOUBLEV

fix

上级 e94d6746
...@@ -438,10 +438,10 @@ class KieLabelEncode(object): ...@@ -438,10 +438,10 @@ class KieLabelEncode(object):
texts.append(ann['transcription']) texts.append(ann['transcription'])
text_ind = [self.dict[c] for c in text if c in self.dict] text_ind = [self.dict[c] for c in text if c in self.dict]
text_inds.append(text_ind) text_inds.append(text_ind)
if 'label' in anno.keys(): if 'label' in ann.keys():
labels.append(ann['label']) labels.append(ann['label'])
elif 'key_cls' in anno.keys(): elif 'key_cls' in ann.keys():
labels.append(anno['key_cls']) labels.append(ann['key_cls'])
else: else:
raise ValueError("Cannot found 'key_cls' in ann.keys(), please check your training annotation.") raise ValueError("Cannot found 'key_cls' in ann.keys(), please check your training annotation.")
edges.append(ann.get('edge', 0)) edges.append(ann.get('edge', 0))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册