Skip to content

Commit e002b0d

Browse files
authored
bug_fix (#3806)
1 parent 707a94d commit e002b0d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

applications/text_classification/doccano.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ def _check_sum(splits):
115115
level_labels = label.split(args.separator)
116116
for i in range(len(level_labels)):
117117
l = args.separator.join(level_labels[:i + 1])
118-
label_dict.append(l)
118+
if l not in label_dict:
119+
label_dict.append(l)
119120
if l not in label_list:
120121
label_list.append(l)
121122
if args.dirty:
122123
text = ' '.join(text.strip().split('\t')[:-1])
123124
else:
124125
text = ' '.join(text.strip().split('\t'))
125-
example = text + '\t' + ','.join(label_list) + '\n'
126+
example = text + '\t' + ','.join(label_dict) + '\n'
126127
examples.append(example)
127128

128129
if not args.dirty and not args.valid:

0 commit comments

Comments
 (0)