From 68ef0a68ca5da58d6fc051d3947d65553c46f669 Mon Sep 17 00:00:00 2001 From: Daniel Ecer Date: Wed, 19 Aug 2026 15:20:05 +0100 Subject: [PATCH] Rebuild training data B-/I- from element boundaries AbstractTrainingTeiParser assigned the entity prefix only when the label changed, and skipped whitespace-only text nodes without touching the previous label. Two sibling elements sharing a label, with only whitespace between them, therefore came back as one entity: the second element's start was lost, and generate_delft_data maps our B- to GROBID's I- start marker, so a start the parser never emitted could not reappear in the artifact. Where a boundary did survive it survived incidentally - any non-whitespace separator is labelled O, which changed the previous label and restored the next start, so two idno elements separated by a comma were kept apart and the same pair separated by a space were not. is_start on TeiTrainingText already means "first text run in this element", including across , so the guard is all that had to go. A whitespace-only run no longer spends the flag either, which is what a single space before a nested