Text Classification
Transformers
Safetensors
English
modernbert
orality
linguistics
rhetorical-analysis
Eval Results (legacy)
text-embeddings-inference
Instructions to use HavelockAI/bert-marker-subtype with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HavelockAI/bert-marker-subtype with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="HavelockAI/bert-marker-subtype")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("HavelockAI/bert-marker-subtype") model = AutoModelForSequenceClassification.from_pretrained("HavelockAI/bert-marker-subtype") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- README.md +101 -95
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -25,10 +25,10 @@ model-index:
|
|
| 25 |
name: Marker Subtype Classification
|
| 26 |
metrics:
|
| 27 |
- type: f1
|
| 28 |
-
value: 0.
|
| 29 |
name: F1 (macro)
|
| 30 |
- type: accuracy
|
| 31 |
-
value: 0.
|
| 32 |
name: Accuracy
|
| 33 |
---
|
| 34 |
|
|
@@ -46,8 +46,8 @@ This is the finest level of the Havelock span classification hierarchy. Given a
|
|
| 46 |
| Architecture | `BertForSequenceClassification` |
|
| 47 |
| Task | Multi-class classification (71 classes) |
|
| 48 |
| Max sequence length | 128 tokens |
|
| 49 |
-
| Best F1 (macro) | **0.
|
| 50 |
-
| Best Accuracy | **0.
|
| 51 |
| Parameters | ~109M |
|
| 52 |
|
| 53 |
## Usage
|
|
@@ -107,24 +107,31 @@ A stratified 80/20 train/test split was used (random seed 42). The test set cont
|
|
| 107 |
|
| 108 |
| Parameter | Value |
|
| 109 |
|-----------|-------|
|
| 110 |
-
| Epochs |
|
| 111 |
-
| Batch size |
|
| 112 |
-
| Learning rate |
|
| 113 |
| Optimizer | AdamW |
|
| 114 |
| LR schedule | Linear warmup (10% of total steps) |
|
| 115 |
| Gradient clipping | 1.0 |
|
| 116 |
-
| Loss | Cross-entropy |
|
| 117 |
| Min examples per class | 15 |
|
| 118 |
|
| 119 |
### Training Metrics
|
| 120 |
|
| 121 |
| Epoch | Loss | Accuracy | F1 (macro) |
|
| 122 |
|-------|------|----------|------------|
|
| 123 |
-
| 1 | 3.
|
| 124 |
-
| 2 | 2.
|
| 125 |
-
| 3 | 1.
|
| 126 |
-
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
### Test Set Classification Report
|
| 130 |
|
|
@@ -132,88 +139,88 @@ Best checkpoint selected by F1 at epoch 3. Loss still declining steeply.
|
|
| 132 |
```
|
| 133 |
precision recall f1-score support
|
| 134 |
|
| 135 |
-
abstract_noun 0.
|
| 136 |
-
additive_formal 0.
|
| 137 |
-
agent_demoted 0.
|
| 138 |
-
agentless_passive 0.
|
| 139 |
-
alliteration 0.
|
| 140 |
-
anaphora 0.
|
| 141 |
-
antithesis 0.
|
| 142 |
-
aside 0.
|
| 143 |
-
assonance 0.
|
| 144 |
-
asyndeton 0.
|
| 145 |
-
audience_response 0.
|
| 146 |
-
categorical_statement 0.
|
| 147 |
-
causal_chain 0.
|
| 148 |
-
causal_explicit 0.
|
| 149 |
-
citation 0.
|
| 150 |
-
conceptual_metaphor 0.
|
| 151 |
-
concessive 0.
|
| 152 |
concessive_connector 0.920 0.742 0.821 31
|
| 153 |
-
conditional 0.
|
| 154 |
-
conflict_frame 0.
|
| 155 |
-
contrastive 0.
|
| 156 |
-
cross_reference 0.
|
| 157 |
-
definitional_move 0.
|
| 158 |
-
discourse_formula 0.
|
| 159 |
-
dramatic_pause 0.
|
| 160 |
-
embodied_action 0.
|
| 161 |
-
enumeration 0.
|
| 162 |
-
epistemic_hedge 0.
|
| 163 |
-
epistrophe 0.
|
| 164 |
-
epithet 0.
|
| 165 |
-
everyday_example 0.
|
| 166 |
-
evidential 0.
|
| 167 |
-
footnote_reference
|
| 168 |
-
imperative 0.
|
| 169 |
-
inclusive_we 0.
|
| 170 |
-
institutional_subject 0.
|
| 171 |
-
intensifier_doubling 0.
|
| 172 |
-
lexical_repetition 0.
|
| 173 |
-
list_structure 0.
|
| 174 |
-
metadiscourse 0.
|
| 175 |
-
methodological_framing 0.
|
| 176 |
-
named_individual 0.
|
| 177 |
-
nested_clauses 0.
|
| 178 |
-
nominalization 0.
|
| 179 |
-
objectifying_stance 0.
|
| 180 |
-
parallelism 0.
|
| 181 |
-
phatic_check
|
| 182 |
-
phatic_filler 0.
|
| 183 |
-
polysyndeton 0.
|
| 184 |
-
probability 0.
|
| 185 |
-
proverb 0.
|
| 186 |
-
qualified_assertion 0.
|
| 187 |
-
refrain 0.
|
| 188 |
-
relative_chain 0.
|
| 189 |
-
religious_formula 0.
|
| 190 |
-
rhetorical_question 0.
|
| 191 |
-
rhyme 0.
|
| 192 |
-
rhythm 0.
|
| 193 |
-
second_person 0.
|
| 194 |
-
self_correction 0.
|
| 195 |
-
sensory_detail 0.
|
| 196 |
-
simple_conjunction 0.
|
| 197 |
-
specific_place
|
| 198 |
-
technical_abbreviation
|
| 199 |
-
technical_term 0.
|
| 200 |
-
temporal_anchor 0.
|
| 201 |
-
temporal_embedding 0.
|
| 202 |
-
third_person_reference 0.
|
| 203 |
-
tricolon 0.
|
| 204 |
-
us_them 0.
|
| 205 |
-
vocative 0.
|
| 206 |
-
|
| 207 |
-
accuracy 0.
|
| 208 |
-
macro avg 0.
|
| 209 |
-
weighted avg 0.
|
| 210 |
```
|
| 211 |
|
| 212 |
</details>
|
| 213 |
|
| 214 |
-
**Top performing subtypes (F1 > 0.75):** `assonance` (0.
|
| 215 |
|
| 216 |
-
**
|
| 217 |
|
| 218 |
## Class Distribution
|
| 219 |
|
|
@@ -228,10 +235,10 @@ The test set exhibits significant imbalance across 71 classes:
|
|
| 228 |
|
| 229 |
## Limitations
|
| 230 |
|
| 231 |
-
- **
|
| 232 |
- **71-way classification on ~23k spans**: The data budget per class is thin, particularly for classes near the 15-example minimum. More data or class consolidation would help.
|
| 233 |
- **Semantic overlap**: Some subtypes are difficult to distinguish from surface text alone (e.g., `parallelism` vs `anaphora` vs `tricolon`; `epistemic_hedge` vs `qualified_assertion` vs `probability`). The model may benefit from hierarchical classification that conditions on type-level predictions.
|
| 234 |
-
- **Recall-precision tradeoff**: Many rare classes show high precision but
|
| 235 |
- **Span-level only**: Requires pre-extracted spans. Does not detect boundaries.
|
| 236 |
- **128-token context window**: Longer spans are truncated.
|
| 237 |
|
|
@@ -245,9 +252,9 @@ The 71 subtypes represent the full granularity of the Havelock taxonomy, operati
|
|
| 245 |
|-------|------|---------|-----|
|
| 246 |
| [`HavelockAI/bert-marker-category`](https://huggingface.co/HavelockAI/bert-marker-category) | Binary (oral/literate) | 2 | 0.875 |
|
| 247 |
| [`HavelockAI/bert-marker-type`](https://huggingface.co/HavelockAI/bert-marker-type) | Functional type | 25 | 0.449 |
|
| 248 |
-
| **This model** | Fine-grained subtype | 71 | 0.
|
| 249 |
| [`HavelockAI/bert-orality-regressor`](https://huggingface.co/HavelockAI/bert-orality-regressor) | Document-level score | Regression | MAE 0.079 |
|
| 250 |
-
| [`HavelockAI/bert-token-classifier`](https://huggingface.co/HavelockAI/bert-token-classifier) | Span detection (BIO) | 145 | 0.
|
| 251 |
|
| 252 |
## Citation
|
| 253 |
```bibtex
|
|
@@ -265,5 +272,4 @@ The 71 subtypes represent the full granularity of the Havelock taxonomy, operati
|
|
| 265 |
|
| 266 |
---
|
| 267 |
|
| 268 |
-
*Trained: February 2026*
|
| 269 |
-
*Model version: da931b4a · Trained: February 2026*
|
|
|
|
| 25 |
name: Marker Subtype Classification
|
| 26 |
metrics:
|
| 27 |
- type: f1
|
| 28 |
+
value: 0.5320
|
| 29 |
name: F1 (macro)
|
| 30 |
- type: accuracy
|
| 31 |
+
value: 0.517
|
| 32 |
name: Accuracy
|
| 33 |
---
|
| 34 |
|
|
|
|
| 46 |
| Architecture | `BertForSequenceClassification` |
|
| 47 |
| Task | Multi-class classification (71 classes) |
|
| 48 |
| Max sequence length | 128 tokens |
|
| 49 |
+
| Best F1 (macro) | **0.5320** |
|
| 50 |
+
| Best Accuracy | **0.517** |
|
| 51 |
| Parameters | ~109M |
|
| 52 |
|
| 53 |
## Usage
|
|
|
|
| 107 |
|
| 108 |
| Parameter | Value |
|
| 109 |
|-----------|-------|
|
| 110 |
+
| Epochs | 10 |
|
| 111 |
+
| Batch size | 256 |
|
| 112 |
+
| Learning rate | 1.5e-4 |
|
| 113 |
| Optimizer | AdamW |
|
| 114 |
| LR schedule | Linear warmup (10% of total steps) |
|
| 115 |
| Gradient clipping | 1.0 |
|
| 116 |
+
| Loss | Cross-entropy with class weights (range 0.23–4.33) |
|
| 117 |
| Min examples per class | 15 |
|
| 118 |
|
| 119 |
### Training Metrics
|
| 120 |
|
| 121 |
| Epoch | Loss | Accuracy | F1 (macro) |
|
| 122 |
|-------|------|----------|------------|
|
| 123 |
+
| 1 | 3.7795 | 0.3249 | 0.1618 |
|
| 124 |
+
| 2 | 2.3703 | 0.4918 | 0.4254 |
|
| 125 |
+
| 3 | 1.5864 | 0.5139 | 0.4964 |
|
| 126 |
+
| 4 | 1.0582 | 0.5195 | 0.5238 |
|
| 127 |
+
| 5 | 0.6955 | 0.5189 | 0.5196 |
|
| 128 |
+
| 6 | 0.4761 | 0.5148 | 0.5227 |
|
| 129 |
+
| 7 | 0.3279 | 0.5178 | **0.5320** |
|
| 130 |
+
| 8 | 0.2419 | 0.5119 | 0.5213 |
|
| 131 |
+
| 9 | 0.1885 | 0.5206 | 0.5283 |
|
| 132 |
+
| 10 | 0.1454 | 0.5169 | 0.5250 |
|
| 133 |
+
|
| 134 |
+
Best checkpoint selected by F1 at epoch 7. Accuracy plateaus from epoch 3 onward while F1 continues improving through rare-class gains.
|
| 135 |
|
| 136 |
### Test Set Classification Report
|
| 137 |
|
|
|
|
| 139 |
```
|
| 140 |
precision recall f1-score support
|
| 141 |
|
| 142 |
+
abstract_noun 0.315 0.312 0.314 144
|
| 143 |
+
additive_formal 0.478 0.423 0.449 26
|
| 144 |
+
agent_demoted 0.909 0.645 0.755 31
|
| 145 |
+
agentless_passive 0.533 0.543 0.538 105
|
| 146 |
+
alliteration 0.632 0.400 0.490 30
|
| 147 |
+
anaphora 0.526 0.466 0.494 88
|
| 148 |
+
antithesis 0.641 0.806 0.714 31
|
| 149 |
+
aside 0.261 0.218 0.238 55
|
| 150 |
+
assonance 0.917 1.000 0.957 33
|
| 151 |
+
asyndeton 0.677 0.700 0.689 30
|
| 152 |
+
audience_response 0.808 0.700 0.750 30
|
| 153 |
+
categorical_statement 0.329 0.245 0.281 98
|
| 154 |
+
causal_chain 0.442 0.425 0.433 80
|
| 155 |
+
causal_explicit 0.406 0.406 0.406 69
|
| 156 |
+
citation 0.646 0.627 0.636 67
|
| 157 |
+
conceptual_metaphor 0.298 0.233 0.262 73
|
| 158 |
+
concessive 0.690 0.659 0.674 88
|
| 159 |
concessive_connector 0.920 0.742 0.821 31
|
| 160 |
+
conditional 0.620 0.684 0.650 155
|
| 161 |
+
conflict_frame 0.833 0.806 0.820 31
|
| 162 |
+
contrastive 0.463 0.543 0.500 116
|
| 163 |
+
cross_reference 0.538 0.412 0.467 34
|
| 164 |
+
definitional_move 0.300 0.308 0.304 39
|
| 165 |
+
discourse_formula 0.559 0.565 0.562 276
|
| 166 |
+
dramatic_pause 0.781 0.806 0.794 31
|
| 167 |
+
embodied_action 0.333 0.362 0.347 69
|
| 168 |
+
enumeration 0.607 0.600 0.604 85
|
| 169 |
+
epistemic_hedge 0.491 0.554 0.521 101
|
| 170 |
+
epistrophe 0.867 0.812 0.839 32
|
| 171 |
+
epithet 0.424 0.519 0.467 27
|
| 172 |
+
everyday_example 0.361 0.317 0.338 41
|
| 173 |
+
evidential 0.526 0.556 0.541 54
|
| 174 |
+
footnote_reference 0.615 0.533 0.571 15
|
| 175 |
+
imperative 0.659 0.753 0.703 146
|
| 176 |
+
inclusive_we 0.613 0.608 0.611 120
|
| 177 |
+
institutional_subject 0.600 0.581 0.590 31
|
| 178 |
+
intensifier_doubling 0.833 0.667 0.741 30
|
| 179 |
+
lexical_repetition 0.486 0.564 0.522 94
|
| 180 |
+
list_structure 0.286 0.278 0.282 36
|
| 181 |
+
metadiscourse 0.320 0.276 0.296 87
|
| 182 |
+
methodological_framing 0.269 0.219 0.241 32
|
| 183 |
+
named_individual 0.364 0.436 0.397 55
|
| 184 |
+
nested_clauses 0.370 0.310 0.338 87
|
| 185 |
+
nominalization 0.377 0.433 0.403 120
|
| 186 |
+
objectifying_stance 0.125 0.233 0.163 43
|
| 187 |
+
parallelism 0.218 0.293 0.250 58
|
| 188 |
+
phatic_check 0.636 0.667 0.651 21
|
| 189 |
+
phatic_filler 0.333 0.400 0.364 30
|
| 190 |
+
polysyndeton 0.964 0.844 0.900 32
|
| 191 |
+
probability 0.574 0.551 0.562 49
|
| 192 |
+
proverb 0.304 0.226 0.259 31
|
| 193 |
+
qualified_assertion 0.219 0.233 0.226 60
|
| 194 |
+
refrain 0.818 0.600 0.692 30
|
| 195 |
+
relative_chain 0.558 0.504 0.530 115
|
| 196 |
+
religious_formula 0.840 0.656 0.737 32
|
| 197 |
+
rhetorical_question 0.686 0.745 0.714 161
|
| 198 |
+
rhyme 0.480 0.375 0.421 32
|
| 199 |
+
rhythm 0.778 0.875 0.824 32
|
| 200 |
+
second_person 0.543 0.596 0.568 235
|
| 201 |
+
self_correction 0.826 0.633 0.717 30
|
| 202 |
+
sensory_detail 0.387 0.324 0.353 37
|
| 203 |
+
simple_conjunction 0.222 0.195 0.208 41
|
| 204 |
+
specific_place 0.526 0.385 0.444 26
|
| 205 |
+
technical_abbreviation 0.278 0.263 0.270 19
|
| 206 |
+
technical_term 0.615 0.466 0.530 161
|
| 207 |
+
temporal_anchor 0.404 0.429 0.416 49
|
| 208 |
+
temporal_embedding 0.438 0.519 0.475 81
|
| 209 |
+
third_person_reference 0.788 0.839 0.812 31
|
| 210 |
+
tricolon 0.607 0.567 0.586 30
|
| 211 |
+
us_them 0.606 0.645 0.625 31
|
| 212 |
+
vocative 0.643 0.621 0.632 58
|
| 213 |
+
|
| 214 |
+
accuracy 0.517 4608
|
| 215 |
+
macro avg 0.540 0.517 0.525 4608
|
| 216 |
+
weighted avg 0.522 0.517 0.517 4608
|
| 217 |
```
|
| 218 |
|
| 219 |
</details>
|
| 220 |
|
| 221 |
+
**Top performing subtypes (F1 > 0.75):** `assonance` (0.957), `polysyndeton` (0.900), `epistrophe` (0.839), `rhythm` (0.824), `concessive_connector` (0.821), `conflict_frame` (0.820), `third_person_reference` (0.812), `dramatic_pause` (0.794), `agent_demoted` (0.755), `audience_response` (0.750).
|
| 222 |
|
| 223 |
+
**Weakest subtypes (F1 < 0.25):** `objectifying_stance` (0.163), `simple_conjunction` (0.208), `qualified_assertion` (0.226), `aside` (0.238), `methodological_framing` (0.241), `parallelism` (0.250). These tend to be semantically diffuse classes that overlap heavily with neighbouring subtypes.
|
| 224 |
|
| 225 |
## Class Distribution
|
| 226 |
|
|
|
|
| 235 |
|
| 236 |
## Limitations
|
| 237 |
|
| 238 |
+
- **Accuracy plateau with F1 headroom**: Accuracy saturated around 0.52 from epoch 3 while F1 continued climbing through epoch 7, suggesting the model is still finding better decision boundaries for rare classes. Further training with LR decay or curriculum strategies may help.
|
| 239 |
- **71-way classification on ~23k spans**: The data budget per class is thin, particularly for classes near the 15-example minimum. More data or class consolidation would help.
|
| 240 |
- **Semantic overlap**: Some subtypes are difficult to distinguish from surface text alone (e.g., `parallelism` vs `anaphora` vs `tricolon`; `epistemic_hedge` vs `qualified_assertion` vs `probability`). The model may benefit from hierarchical classification that conditions on type-level predictions.
|
| 241 |
+
- **Recall-precision tradeoff**: Many rare classes show high precision but lower recall (e.g., `polysyndeton`: P=0.964, R=0.844; `agent_demoted`: P=0.909, R=0.645), suggesting the model learns narrow prototypes but misses variation.
|
| 242 |
- **Span-level only**: Requires pre-extracted spans. Does not detect boundaries.
|
| 243 |
- **128-token context window**: Longer spans are truncated.
|
| 244 |
|
|
|
|
| 252 |
|-------|------|---------|-----|
|
| 253 |
| [`HavelockAI/bert-marker-category`](https://huggingface.co/HavelockAI/bert-marker-category) | Binary (oral/literate) | 2 | 0.875 |
|
| 254 |
| [`HavelockAI/bert-marker-type`](https://huggingface.co/HavelockAI/bert-marker-type) | Functional type | 25 | 0.449 |
|
| 255 |
+
| **This model** | Fine-grained subtype | 71 | 0.532 |
|
| 256 |
| [`HavelockAI/bert-orality-regressor`](https://huggingface.co/HavelockAI/bert-orality-regressor) | Document-level score | Regression | MAE 0.079 |
|
| 257 |
+
| [`HavelockAI/bert-token-classifier`](https://huggingface.co/HavelockAI/bert-token-classifier) | Span detection (BIO) | 145 | 0.500 |
|
| 258 |
|
| 259 |
## Citation
|
| 260 |
```bibtex
|
|
|
|
| 272 |
|
| 273 |
---
|
| 274 |
|
| 275 |
+
*Model version: da931b4a · Trained: February 2026*
|
|
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 438170868
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:908751e3d1db4b122a3c05ea81d50dfbef7cacda40e601e6b09905b8aa7fb99f
|
| 3 |
size 438170868
|