Skip to content

Commit ebe96f2

Browse files
author
Anna Mironova
authored
Updated TextClassificationAnnotation (openvinotoolkit#1648)
1 parent 7f92c8c commit ebe96f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/accuracy_checker/accuracy_checker/representation/nlp_representation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def __init__(self, identifier, title, context, query, answers, context_word, con
123123

124124

125125
class TextClassificationAnnotation(ClassificationAnnotation):
126-
def __init__(self, identifier, label, input_ids, input_mask, segment_ids, tokens):
126+
def __init__(self, identifier, label, input_ids, input_mask=None, segment_ids=None, tokens=None):
127127
super().__init__(identifier, label)
128128
self.input_ids = input_ids
129-
self.input_mask = input_mask
130-
self.segment_ids = segment_ids
131-
self.tokens = tokens
129+
self.input_mask = input_mask if input_mask is not None else []
130+
self.segment_ids = segment_ids if segment_ids is not None else []
131+
self.tokens = tokens if tokens is not None else []

0 commit comments

Comments
 (0)