kiji-proxy icon indicating copy to clipboard operation
kiji-proxy copied to clipboard

Label Studio converter labels every repeat of a labelled value, whatever its meaning

Open Davidnet opened this issue 2 weeks ago • 0 comments

Found while reviewing #688. Code: model/dataset/labelstudio/labelstudio_format.py:75-85, 173-186.

The converter's second pass labels every whole-word repeat of a labelled value, whatever it means in context:

  • "Frau Lange hat angerufen. Lange Wartezeiten …": both "Lange" become SURNAME.
  • "Herr Koch … der Koch der Kantine": both "Koch" become SURNAME.
  • "April Jones paid on 3 April 2025": the month becomes FIRSTNAME.
  • Generated rows are affected too. "Seat Leon 5F" gets FIRSTNAME whenever the person is named Leon (about 1 in 10k German template rows).

convert_to_labelstudio is shared with import_ai4privacy.py, download_dataset_from_hf.py and openai/training_set.py, so their outputs changed too.

Related: the fallback search (:166-171) ignores the new overlap guard. "Anna-Lena" plus "Lena" without offsets gives overlapping spans.

Suggested fix: only label a repeat when its context is name-like (capitalised, not sentence-initial, not followed by a noun, not a month or common noun). Or turn the second pass off for generator rows, which already have exact offsets. Add tests for the cases above, and one asserting that generator rows get no extra labels.

Davidnet avatar Nov 17 '26 02:11 Davidnet