The model's config.json defines a real id2label mapping
({"0": "off_task", "1": "on_task"}), so transformers.pipeline
returns "on_task"/"off_task", not the generic "LABEL_1"/"LABEL_0"
fallback used when no id2label is present. The placeholder
comparison against 'LABEL_1' never matched, so mathWord was always
False (0 utterances flagged instead of the ~75 the vocabulary
approach found).
New measures/OnTaskAnalyser.py (mirrors VocabularyAnalyser's shape:
self-contained, owns its own model instance, no shared handler
device/tokenizer/input-builder) runs edsi-umd/on-task-bert on student
utterances. moments.mathWord is now derived from that classifier
instead of bool(vocabulary_terms).
vocabularyTerms/vocabularyMatches/vocabularyTable are untouched -
VocabularyAnalyser keeps running as-is, since the frontend's
MathVocabularyTable needs the per-word match data the classifier
can't produce.
TODO: confirm the exact label string on-task-bert's pipeline returns
for "on-task" (see ON_TASK_LABEL in OnTaskAnalyser.py) with a real
inference call before relying on this in production.