Improve strided span
@@ -96,7 +96,10 @@ def configure_strided_spans(window: int, stride: int) -> Callable:
start = 0
for i in range(len(doc) // stride):
spans.append(doc[start : start + window])
+ if (start + window) >= len(doc):
+ break
start += stride
+ else:
if start < len(doc):
spans.append(doc[start:])
return spans
