thesanogoeffect commited on
Commit
cf7c2d8
·
verified ·
1 Parent(s): ee1a83d

Retrain on section_v5b (leak-filtered) with the v4 recipe

Browse files
README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: bibr
3
+ base_model: sentence-transformers/all-MiniLM-L6-v2
4
+ language: en
5
+ tags:
6
+ - text-classification
7
+ - scholarly-documents
8
+ ---
9
+
10
+ # bibr section classifier
11
+
12
+ Two-head classifier that bibr uses to type section headings it cannot resolve
13
+ with its alias lookup. It predicts one of 16 canonical section types and
14
+ whether the heading is top level. Encoder: all-MiniLM-L6-v2 (22M parameters),
15
+ mean pooling, input template v3 (heading, position bucket, neighbouring
16
+ headings, start of the body).
17
+
18
+ This revision retrains the same architecture and template on a larger,
19
+ re-labelled corpus. It is a drop-in replacement for the September 2026
20
+ release: same files, same label order, same runtime cost.
21
+
22
+ ## Training data
23
+
24
+ - `section_v5b_leakfiltered`: section headings from PMC Open Access JATS
25
+ papers (English), paper-grouped train/val/test split. Three papers removed
26
+ by a later leak re-check are excluded.
27
+ - Train subsample of at most 3,000 rows per class: 45,979 rows from 6,946 papers.
28
+ Epoch chosen on the v5b validation split only.
29
+ - No bibr-validation gold, blind evaluation, or held-out benchmark paper is in
30
+ the training or validation data (matched by DOI, PMCID and title).
31
+
32
+ ## Evaluation
33
+
34
+ Canonical-type macro-F1 / accuracy (model-routed rows: macro-F1). "Model-routed" is the subset bibr
35
+ actually sends to this model (headings the alias lookup misses), scored on
36
+ bibr's section gold.
37
+
38
+ | set | previous release | this revision |
39
+ |---|---|---|
40
+ | v5b test (English JATS, 9,507 headings) | 0.589 / 0.398 | 0.966 / 0.946 |
41
+ | gold, English headings (9,501) | 0.656 / 0.572 | 0.798 / 0.784 |
42
+ | gold, non-English headings (1,524) | 0.213 / 0.295 | 0.265 / 0.344 |
43
+ | gold, model-routed English (3,472) | 0.419 | 0.676 |
44
+ | gold, model-routed non-English (1,240) | 0.168 | 0.217 |
45
+
46
+ Part of the gain on gold comes from shared labelling conventions: the
47
+ training data and the gold both label subsections by their parent type and
48
+ structured-abstract parts as abstract.
49
+
50
+ Non-English headings are zero-shot: the training data is English only.
51
+
52
+ ## Files
53
+
54
+ `model.safetensors`, `tokenizer.json`, `tokenizer_config.json`,
55
+ `label_classes.json`, `inference_config.json` (template version 3), and an
56
+ ONNX Runtime bundle in `onnx/` used by bibr's core install.
classification_report.json CHANGED
@@ -1,111 +1,111 @@
1
  {
2
  "abstract": {
3
- "f1-score": 1.0,
4
- "precision": 1.0,
5
- "recall": 1.0,
6
- "support": 388.0
7
  },
8
- "accuracy": 0.9930157593123209,
9
  "acknowledgment": {
10
- "f1-score": 0.9958847736625515,
11
- "precision": 1.0,
12
- "recall": 0.9918032786885246,
13
- "support": 244.0
14
  },
15
  "author_contributions": {
16
- "f1-score": 0.9710144927536232,
17
- "precision": 0.9710144927536232,
18
- "recall": 0.9710144927536232,
19
- "support": 69.0
20
  },
21
  "coi": {
22
- "f1-score": 0.971830985915493,
23
- "precision": 0.9857142857142858,
24
- "recall": 0.9583333333333334,
25
- "support": 72.0
26
  },
27
  "discussion": {
28
- "f1-score": 0.9896519285042333,
29
- "precision": 0.9868667917448405,
30
- "recall": 0.9924528301886792,
31
- "support": 530.0
32
  },
33
  "endnote": {
34
- "f1-score": 0.9929446713702191,
35
- "precision": 0.9896373056994818,
36
- "recall": 0.996274217585693,
37
- "support": 1342.0
38
  },
39
  "ethics": {
40
- "f1-score": 0.9808917197452229,
41
- "precision": 1.0,
42
- "recall": 0.9625,
43
- "support": 160.0
44
  },
45
  "funding": {
46
- "f1-score": 0.9964664310954063,
47
- "precision": 0.9964664310954063,
48
- "recall": 0.9964664310954063,
49
- "support": 283.0
50
  },
51
  "intro": {
52
- "f1-score": 0.9984917043740573,
53
- "precision": 0.9969879518072289,
54
- "recall": 1.0,
55
- "support": 331.0
56
  },
57
  "keywords": {
58
  "f1-score": 1.0,
59
  "precision": 1.0,
60
  "recall": 1.0,
61
- "support": 286.0
62
  },
63
  "macro avg": {
64
- "f1-score": 0.9896559151772297,
65
- "precision": 0.990745651057533,
66
- "recall": 0.9886625840013419,
67
- "support": 5584.0
68
  },
69
  "method": {
70
- "f1-score": 0.9873417721518988,
71
- "precision": 0.9811320754716981,
72
- "recall": 0.9936305732484076,
73
- "support": 157.0
74
  },
75
  "open_data": {
76
- "f1-score": 0.9726027397260274,
77
- "precision": 0.9726027397260274,
78
- "recall": 0.9726027397260274,
79
- "support": 73.0
80
  },
81
  "references": {
82
- "f1-score": 1.0,
83
- "precision": 1.0,
84
  "recall": 1.0,
85
- "support": 345.0
86
  },
87
  "results": {
88
- "f1-score": 0.9895470383275261,
89
- "precision": 0.9793103448275862,
90
- "recall": 1.0,
91
- "support": 142.0
92
  },
93
  "title": {
94
- "f1-score": 0.998661311914324,
95
- "precision": 0.9973262032085561,
96
  "recall": 1.0,
97
- "support": 373.0
98
  },
99
  "unknown": {
100
- "f1-score": 0.9891650732950924,
101
- "precision": 0.9948717948717949,
102
- "recall": 0.9835234474017744,
103
- "support": 789.0
104
  },
105
  "weighted avg": {
106
- "f1-score": 0.9930047754292499,
107
- "precision": 0.9930450267296388,
108
- "recall": 0.9930157593123209,
109
- "support": 5584.0
110
  }
111
- }
 
1
  {
2
  "abstract": {
3
+ "f1-score": 0.9793224813022438,
4
+ "precision": 0.9780316344463972,
5
+ "recall": 0.9806167400881057,
6
+ "support": 1135.0
7
  },
8
+ "accuracy": 0.9469550038789759,
9
  "acknowledgment": {
10
+ "f1-score": 0.9980732177263969,
11
+ "precision": 0.9961538461538462,
12
+ "recall": 1.0,
13
+ "support": 259.0
14
  },
15
  "author_contributions": {
16
+ "f1-score": 0.996268656716418,
17
+ "precision": 0.9925650557620818,
18
+ "recall": 1.0,
19
+ "support": 267.0
20
  },
21
  "coi": {
22
+ "f1-score": 1.0,
23
+ "precision": 1.0,
24
+ "recall": 1.0,
25
+ "support": 306.0
26
  },
27
  "discussion": {
28
+ "f1-score": 0.9074598677998111,
29
+ "precision": 0.8720508166969148,
30
+ "recall": 0.9458661417322834,
31
+ "support": 1016.0
32
  },
33
  "endnote": {
34
+ "f1-score": 0.9792694965449161,
35
+ "precision": 0.9841269841269841,
36
+ "recall": 0.9744597249508841,
37
+ "support": 509.0
38
  },
39
  "ethics": {
40
+ "f1-score": 0.9879518072289156,
41
+ "precision": 0.9787798408488063,
42
+ "recall": 0.9972972972972973,
43
+ "support": 370.0
44
  },
45
  "funding": {
46
+ "f1-score": 0.9963369963369964,
47
+ "precision": 0.9927007299270073,
48
+ "recall": 1.0,
49
+ "support": 136.0
50
  },
51
  "intro": {
52
+ "f1-score": 0.9057971014492754,
53
+ "precision": 0.8756567425569177,
54
+ "recall": 0.9380863039399625,
55
+ "support": 533.0
56
  },
57
  "keywords": {
58
  "f1-score": 1.0,
59
  "precision": 1.0,
60
  "recall": 1.0,
61
+ "support": 299.0
62
  },
63
  "macro avg": {
64
+ "f1-score": 0.9660878230241505,
65
+ "precision": 0.9610242032951976,
66
+ "recall": 0.9717595906879481,
67
+ "support": 10312.0
68
  },
69
  "method": {
70
+ "f1-score": 0.9330569948186529,
71
+ "precision": 0.9627887082976904,
72
+ "recall": 0.9051065540812223,
73
+ "support": 2487.0
74
  },
75
  "open_data": {
76
+ "f1-score": 0.9982300884955753,
77
+ "precision": 0.9964664310954063,
78
+ "recall": 1.0,
79
+ "support": 282.0
80
  },
81
  "references": {
82
+ "f1-score": 0.9987357774968394,
83
+ "precision": 0.9974747474747475,
84
  "recall": 1.0,
85
+ "support": 395.0
86
  },
87
  "results": {
88
+ "f1-score": 0.9197598253275109,
89
+ "precision": 0.9157608695652174,
90
+ "recall": 0.9237938596491229,
91
+ "support": 1824.0
92
  },
93
  "title": {
94
+ "f1-score": 0.9655172413793104,
95
+ "precision": 0.9333333333333333,
96
  "recall": 1.0,
97
+ "support": 84.0
98
  },
99
  "unknown": {
100
+ "f1-score": 0.8916256157635468,
101
+ "precision": 0.900497512437811,
102
+ "recall": 0.8829268292682927,
103
+ "support": 410.0
104
  },
105
  "weighted avg": {
106
+ "f1-score": 0.9470639159236539,
107
+ "precision": 0.9480511203001257,
108
+ "recall": 0.9469550038789759,
109
+ "support": 10312.0
110
  }
111
+ }
gate.json CHANGED
@@ -1,46 +1,8 @@
1
  {
2
- "checkpoint": "/tmp/bibr-training-phasec-830a047/checkpoints/section_v4_release",
3
- "config": "configs/section_classifier_v4.yaml",
4
- "corpus": "/tmp/bibr-training-phasec-830a047/section_v4",
5
- "corpus_papers": 2482,
6
- "corpus_rows": 36517,
7
- "delta": 0.09518694180243625,
8
- "label_classes": [
9
- "abstract",
10
- "acknowledgment",
11
- "author_contributions",
12
- "coi",
13
- "discussion",
14
- "endnote",
15
- "ethics",
16
- "funding",
17
- "intro",
18
- "keywords",
19
- "method",
20
- "open_data",
21
- "references",
22
- "results",
23
- "title",
24
- "unknown"
25
- ],
26
  "metric": "test_type_macro_f1",
27
- "observed": 0.9896559151772297,
28
- "pass": true,
29
- "reason": "pass",
30
- "split_summary": {
31
- "test": {
32
- "papers": 373,
33
- "rows": 5584
34
- },
35
- "train": {
36
- "papers": 1860,
37
- "rows": 27294
38
- },
39
- "val": {
40
- "papers": 249,
41
- "rows": 3639
42
- }
43
- },
44
- "threshold": 0.8944689733747935,
45
- "v3_reference_type_macro_f1": 0.8944689733747935
46
- }
 
1
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  "metric": "test_type_macro_f1",
3
+ "split": "v5b test, v4-candidate papers removed",
4
+ "observed": 0.9656228154012606,
5
+ "previous_release_same_rows": 0.5887,
6
+ "gold_english_macro_f1": 0.7977,
7
+ "previous_release_gold_english_macro_f1": 0.656
8
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8827d8ead8603bdff650774f07edbb6d77e56fb8c2486de9fdc59d6ce5b1aea3
3
- size 90891540
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c155834e88f6e7e9d3528225079ef57bf32b5108695e7e9a288cd745e0871de
3
+ size 90891508
onnx/bibr_onnx.json CHANGED
@@ -64,16 +64,16 @@
64
  "pad_token_id": 0,
65
  "schema_version": 1,
66
  "source": {
67
- "exported_at": "2026-09-02T20:32:41+00:00",
68
- "numpy": "2.3.5",
69
- "onnx": "1.22.0",
70
  "onnxruntime": "1.27.0",
71
- "platform": "Linux-7.2.2-1-cachyos-x86_64-with-glibc2.44",
72
  "python": "3.12.14",
73
  "repo_id": "scienceverse/bibr-section-classifier",
74
- "revision": "969112772a8940d46c5d6b19feee45eeebfd26f9",
75
- "torch": "2.11.0+cu130",
76
- "transformers": "5.14.1"
77
  },
78
  "template_version": 3,
79
  "tokenizer_file": "tokenizer.json"
 
64
  "pad_token_id": 0,
65
  "schema_version": 1,
66
  "source": {
67
+ "exported_at": "2026-10-13T21:41:08+00:00",
68
+ "numpy": "2.5.1",
69
+ "onnx": "1.23.0",
70
  "onnxruntime": "1.27.0",
71
+ "platform": "Linux-7.2.9-2-cachyos-x86_64-with-glibc2.44",
72
  "python": "3.12.14",
73
  "repo_id": "scienceverse/bibr-section-classifier",
74
+ "revision": null,
75
+ "torch": "2.13.0+cpu",
76
+ "transformers": "5.13.1"
77
  },
78
  "template_version": 3,
79
  "tokenizer_file": "tokenizer.json"
onnx/model.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:474de26402d09ddf8db15308b9ebe2e6f8251856d895fccdbf6d18ec5e0ea707
3
  size 90427110
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:737950aed5a4b626fe336f30dfc9d8aa7bdaf1f7a6fb76bce87a1e0575f15303
3
  size 90427110
test_metrics.json CHANGED
@@ -1,27 +1,64 @@
1
  {
2
- "checkpoint": "/tmp/bibr-training-phasec-830a047/checkpoints/section_v4_release",
3
- "config": "configs/section_classifier_v4.yaml",
4
- "corpus": "/tmp/bibr-training-phasec-830a047/section_v4",
5
- "corpus_papers": 2482,
6
- "corpus_rows": 36517,
7
- "n_test": 5584,
8
- "n_test_papers": 373,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  "split_summary": {
10
  "test": {
11
- "papers": 373,
12
- "rows": 5584
13
  },
14
  "train": {
15
- "papers": 1860,
16
- "rows": 27294
17
  },
18
  "val": {
19
- "papers": 249,
20
- "rows": 3639
21
  }
22
  },
23
  "template_version": 3,
24
- "test_top_level_f1": 0.988171459576777,
25
- "test_type_macro_f1": 0.9896559151772297,
26
- "test_type_micro_f1": 0.9930157593123209
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  {
2
+ "best_epoch": 5,
3
+ "best_val_acc": 0.9489,
4
+ "best_val_top_acc": 0.9804,
5
+ "best_val_type_macro_f1": 0.966,
6
+ "checkpoint": "this repository revision",
7
+ "corpus": "section_v5b_leakfiltered minus 3 T1-dropped papers (PMC12679984, PMC12751990, PMC12753070; 20 train rows)",
8
+ "corpus_papers": 7711,
9
+ "corpus_rows": 65711,
10
+ "encoder": "sentence-transformers/all-MiniLM-L6-v2@1110a243fdf4706b3f48f1d95db1a4f5529b4d41",
11
+ "gold_score_only": {
12
+ "gold, English headings": {
13
+ "acc": 0.7836,
14
+ "macro_f1": 0.7977,
15
+ "n": 9501
16
+ },
17
+ "gold, all": {
18
+ "acc": 0.7229,
19
+ "macro_f1": 0.7642,
20
+ "n": 11025
21
+ },
22
+ "gold, non-English headings": {
23
+ "acc": 0.3445,
24
+ "macro_f1": 0.2651,
25
+ "n": 1524
26
+ }
27
+ },
28
+ "n_test": 10312,
29
+ "n_test_papers": 396,
30
+ "n_train": 45979,
31
+ "note": "gold = bibr section-heading gold, scored only (never used for training, epoch or model selection); tier2 = gold rows bibr routes to this model (alias-lookup misses)",
32
+ "recipe": "eg2_ft ft.py v4 head (mean pool, CE sqrt class weights + 0.5 BCE top-level, AdamW lr 3e-5, cosine, batch 32, max_len 256, bf16, <=6 epochs, patience 2)",
33
  "split_summary": {
34
  "test": {
35
+ "papers": 396,
36
+ "rows": 10312
37
  },
38
  "train": {
39
+ "papers": 6946,
40
+ "rows": 45979
41
  },
42
  "val": {
43
+ "papers": 369,
44
+ "rows": 9420
45
  }
46
  },
47
  "template_version": 3,
48
+ "test_top_level_acc": 0.9795384018619084,
49
+ "test_top_level_f1": 0.9790653834705824,
50
+ "test_type_macro_f1": 0.9660878230241505,
51
+ "test_type_micro_f1": 0.9469550038789759,
52
+ "test_v4_overlap_removed": {
53
+ "n": 9507,
54
+ "papers": 368,
55
+ "top_level_acc": 0.9793836120753129,
56
+ "top_level_f1": 0.9789969995713673,
57
+ "type_macro_f1": 0.9656228154012606,
58
+ "type_micro_f1": 0.945934574524035
59
+ },
60
+ "tier2_model_routed_macro_f1_score_only": {
61
+ "English headings": 0.6761,
62
+ "non-English headings": 0.2167
63
+ }
64
+ }