fix on-task label string (LABEL_1 -> on_task)
Browse filesThe 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).
measures/OnTaskAnalyser.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
ON_TASK_MODEL = 'edsi-umd/on-task-bert'
|
| 4 |
-
ON_TASK_LABEL = '
|
| 5 |
|
| 6 |
|
| 7 |
class OnTaskAnalyser:
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
|
| 3 |
ON_TASK_MODEL = 'edsi-umd/on-task-bert'
|
| 4 |
+
ON_TASK_LABEL = 'on_task' # from the model's config.json id2label: {"0": "off_task", "1": "on_task"}
|
| 5 |
|
| 6 |
|
| 7 |
class OnTaskAnalyser:
|