sroie-on-layoutlm
sroie-on-layoutlm copied to clipboard
ValueError: empty separator
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-79-5ef70a0f5d68> in <module>()
24 if len(pos) > 0:
25 # print(define_labels(pos, sent, labels, bbox, class_value, classification))
---> 26 sent, labels, bbox = define_labels(pos, sent, labels, bbox, class_value, classification)
27
28 # # Define labels for company name
<ipython-input-71-e92669a96825> in define_labels(pos, sent, labels, bbox, class_value, classification, label_other)
12 # print(sent[i_pos], "==>", str(class_value))
13
---> 14 sent[i_pos] = intersperse(sent[i_pos].split(str(class_value)), str(class_value))
15 # This split leaves a white space element at the initial or final position, so we have to remove it
16 if sent[i_pos][0].isspace() or len(sent[i_pos][0])==0: sent[i_pos] = sent[i_pos][1:]
ValueError: empty separator