Skip to content

Commit 6b50368

Browse files
fix bounds for filtered_labels_id in BertNamedEntityRecognition wrapper (#3341)
1 parent 04ab99c commit 6b50368

File tree

1 file changed

+1
-1
lines changed
  • demos/common/python/openvino/model_zoo/model_api/models

1 file changed

+1
-1
lines changed

demos/common/python/openvino/model_zoo/model_api/models/bert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def postprocess(self, outputs, meta):
106106

107107
filtered_labels_id = [
108108
(i, label_i) for i, label_i in enumerate(labels_id)
109-
if label_i != 0 and 0 < i < self.max_length - meta['pad_len']
109+
if label_i != 0 and 0 < i < self.max_length - meta['pad_len'] - 1
110110
]
111111
return score, filtered_labels_id
112112

0 commit comments

Comments
 (0)