Skip to content

Commit 0d23ffa

Browse files
authored
AC: allow empty text b for text classification (#3182)
1 parent 6af9f4e commit 0d23ffa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/annotation_converters/text_classification.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def read_annotation(self):
107107
guid = "dev-{}".format(idx)
108108
label = self.reversed_label_map[line[self.label_ind]]
109109
text_a = line[self.text_a_ind]
110-
text_b = line[self.text_b_ind] if self.text_b_ind is not None else None
110+
text_b = (
111+
line[self.text_b_ind]
112+
if self.text_b_ind is not None and len(line) > self.text_b_ind else None
113+
)
111114
lines.append(InputExample(guid, text_a, text_b, label))
112115

113116
return lines

0 commit comments

Comments
 (0)