We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b84953c commit 5f8f06dCopy full SHA for 5f8f06d
auto_labeling_pipeline/labels.py
@@ -48,8 +48,13 @@ class SequenceLabels(Labels):
48
def remove_overlapping(self) -> 'Labels':
49
target = self.label_class(start_offset=0, end_offset=0, label='')
50
labels = sorted(self.labels, key=operator.attrgetter('start_offset'))
51
- labels = [target := label for label in labels if not label.overlap_with(target)] # type: ignore
52
- return self.__class__([label.dict() for label in labels])
+ _labels = []
+ for label in labels:
53
+ if label.overlap_with(target):
54
+ continue
55
+ target = label # type: ignore
56
+ _labels.append(label)
57
+ return self.__class__([label.dict() for label in _labels])
58
59
60
class Seq2seqLabels(Labels):
0 commit comments