Text Classification
setfit
Safetensors
English
mpnet
education
classroom-discourse
edubehaviors
assertion
Eval Results (legacy)
Instructions to use StanfordSCALE/assertion_sentence_has_answer_to_a_math_problem with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- setfit
How to use StanfordSCALE/assertion_sentence_has_answer_to_a_math_problem with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("StanfordSCALE/assertion_sentence_has_answer_to_a_math_problem") preds = model.predict(["i loved the spiderman movie!", "pineapple on pizza is the worst"]) print(preds) - Notebooks
- Google Colab
- Kaggle
publish assertion encoder with model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
library_name: setfit
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
| 6 |
+
datasets:
|
| 7 |
+
- StanfordSCALE/assertions_llm_annotated_talkmoves
|
| 8 |
+
metrics:
|
| 9 |
+
- f1
|
| 10 |
+
- precision
|
| 11 |
+
- recall
|
| 12 |
+
- roc_auc
|
| 13 |
+
tags:
|
| 14 |
+
- setfit
|
| 15 |
+
- text-classification
|
| 16 |
+
- education
|
| 17 |
+
- classroom-discourse
|
| 18 |
+
- edubehaviors
|
| 19 |
+
- assertion
|
| 20 |
+
model-index:
|
| 21 |
+
- name: assertion_sentence_has_answer_to_a_math_problem
|
| 22 |
+
results:
|
| 23 |
+
- task:
|
| 24 |
+
type: text-classification
|
| 25 |
+
dataset:
|
| 26 |
+
name: assertions_llm_annotated_talkmoves
|
| 27 |
+
type: StanfordSCALE/assertions_llm_annotated_talkmoves
|
| 28 |
+
split: test
|
| 29 |
+
metrics:
|
| 30 |
+
- type: f1
|
| 31 |
+
value: 0.4639
|
| 32 |
+
name: F1 (positive class, test)
|
| 33 |
+
- type: precision
|
| 34 |
+
value: 0.45
|
| 35 |
+
name: Precision (positive class, test)
|
| 36 |
+
- type: recall
|
| 37 |
+
value: 0.4787
|
| 38 |
+
name: Recall (positive class, test)
|
| 39 |
+
- type: roc_auc
|
| 40 |
+
value: 0.8638
|
| 41 |
+
name: ROC-AUC (test)
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
# Assertion: sentence has answer to a math problem
|
| 46 |
+
|
| 47 |
+
This classifier was trained for *EduBehaviors: Assertion-based schemas for auditable dialogue coding* and is usable through the Python package `EduBehaviors-kit`. This classifier was trained on an LLM-annotated subset of teacher utterances from the [TalkMoves Dataset](https://github.com/SumnerLab/TalkMoves). See the Datasets section below for more information.
|
| 48 |
+
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## Training Details
|
| 52 |
+
|
| 53 |
+
### Datasets
|
| 54 |
+
|
| 55 |
+
| Dataset | Split | Size |
|
| 56 |
+
|---------|-------|------|
|
| 57 |
+
| [StanfordSCALE/assertions_llm_annotated_talkmoves](https://huggingface.co/datasets/StanfordSCALE/assertions_llm_annotated_talkmoves) | train | 3,430 (53.3%) |
|
| 58 |
+
| [StanfordSCALE/assertions_llm_annotated_talkmoves](https://huggingface.co/datasets/StanfordSCALE/assertions_llm_annotated_talkmoves) | dev | 858 (13.3%) |
|
| 59 |
+
| [StanfordSCALE/assertions_llm_annotated_talkmoves](https://huggingface.co/datasets/StanfordSCALE/assertions_llm_annotated_talkmoves) | test | 2,146 (33.4%) |
|
| 60 |
+
|
| 61 |
+
This model's columns are `assertion_sentence_has_answer_to_a_math_problem` and `split_sentence_has_answer_to_a_math_problem`.
|
| 62 |
+
|
| 63 |
+
**Base rate** (share of rows labeled as True): 4.7% overall —
|
| 64 |
+
4.8% train, 5.1% dev, 4.4% test.
|
| 65 |
+
|
| 66 |
+
### Labels and annotation
|
| 67 |
+
|
| 68 |
+
Labels were generated with LLM annotators. Krippendorff's alpha for this assertion is 0.409.
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
### Hyperparameters
|
| 72 |
+
|
| 73 |
+
| Parameter | Value |
|
| 74 |
+
|-----------|-------|
|
| 75 |
+
| Base model (body) | [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2) |
|
| 76 |
+
| Head | `LogisticRegression` |
|
| 77 |
+
| Body learning rate | 2e-05 |
|
| 78 |
+
| Head learning rate | 0.01 |
|
| 79 |
+
| Batch size | 16 (contrastive phase) / 32 (head) |
|
| 80 |
+
| Epochs | 10 |
|
| 81 |
+
| Max steps | 5000 (contrastive phase) |
|
| 82 |
+
| Eval max steps | 100 |
|
| 83 |
+
| Seed | 20260904 |
|
| 84 |
+
| Mixed precision | enabled on GPU |
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
## Evaluation
|
| 89 |
+
|
| 90 |
+
### Results
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
| Split | n | Base rate | Precision | Recall | F1 (positive class) | ROC-AUC | Average precision |
|
| 94 |
+
|-------|---|-----------|-----------|--------|---------------------|---------|-------------------|
|
| 95 |
+
| dev | 858 | 5.1% | 0.500 | 0.364 | 0.421 | 0.878 | 0.450 |
|
| 96 |
+
| test | 2,146 | 4.4% | 0.450 | 0.479 | 0.464 | 0.864 | 0.411 |
|
| 97 |
+
|
| 98 |
+
### Limitations
|
| 99 |
+
|
| 100 |
+
- **Labels come from LLM annotators, not human coders.** Agreement between annotators with Krippendorff's Alpha is 0.409.
|
| 101 |
+
- Trained on teacher utterances only. Behaviour on student speech is untested.
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## How to Use
|
| 107 |
+
|
| 108 |
+
### Message Structure
|
| 109 |
+
|
| 110 |
+
The model was trained on text built as:
|
| 111 |
+
|
| 112 |
+
```
|
| 113 |
+
{utterance}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
The utterance is passed through as-is.
|
| 117 |
+
|
| 118 |
+
### Running instructions
|
| 119 |
+
|
| 120 |
+
```bash
|
| 121 |
+
pip install setfit
|
| 122 |
+
```
|
| 123 |
+
|
| 124 |
+
```python
|
| 125 |
+
from setfit import SetFitModel
|
| 126 |
+
|
| 127 |
+
model = SetFitModel.from_pretrained("StanfordSCALE/assertion_sentence_has_answer_to_a_math_problem")
|
| 128 |
+
|
| 129 |
+
text = 'Okay so thats the largest Yeah'
|
| 130 |
+
model.predict([text]) # -> array([1]) when the assertion holds
|
| 131 |
+
model.predict_proba([text]) # -> [[P(no), P(yes)]]
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
## Citation
|
| 136 |
+
|
| 137 |
+
```bibtex
|
| 138 |
+
@misc{assertion_sentence_has_answer_to_a_math_problem,
|
| 139 |
+
author = {Stanford SCALE Initiative},
|
| 140 |
+
title = {Assertion classifier: sentence has answer to a math problem},
|
| 141 |
+
year = {2026},
|
| 142 |
+
url = {https://huggingface.co/StanfordSCALE/assertion_sentence_has_answer_to_a_math_problem}
|
| 143 |
+
}
|
| 144 |
+
```
|