Upload ettin-68m-both-s1
Browse files- README.md +104 -115
- best.json +4 -4
- config.json +1 -1
- model.safetensors +1 -1
- onnx/model.onnx +2 -2
- run.json +4 -6
- tokenizer_config.json +1 -1
README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
license: mit
|
| 3 |
base_model: jhu-clsp/ettin-encoder-68m
|
| 4 |
base_model_relation: finetune
|
| 5 |
-
library_name:
|
| 6 |
pipeline_tag: text-classification
|
| 7 |
language:
|
| 8 |
- en
|
|
@@ -25,52 +25,44 @@ It is the browser model of the
|
|
| 25 |
[CRediT census](https://github.com/simonvanlierde/credit-matrix/tree/main/census) in
|
| 26 |
[CRediT Matrix](https://github.com/simonvanlierde/credit-matrix).
|
| 27 |
It is [Ettin-68M](https://huggingface.co/jhu-clsp/ettin-encoder-68m) (revision
|
| 28 |
-
`ac19ae4bc51093b31c475665ac872a936d056cc2`), fine-tuned on 166,567 statements
|
| 29 |
-
author of a statement in one pass.
|
| 30 |
Source paths below are in the
|
| 31 |
[census code](https://github.com/simonvanlierde/credit-matrix/tree/main/census/src/census).
|
| 32 |
|
| 33 |
| | |
|
| 34 |
| --- | --- |
|
| 35 |
-
| Run | `ettin-68m-
|
| 36 |
| Hub repository | [`simonvanlierde/credit-statement-reader`](https://huggingface.co/simonvanlierde/credit-statement-reader) |
|
| 37 |
-
| `onnx/
|
| 38 |
-
| `onnx/model.onnx` sha256 | `
|
| 39 |
-
| `model.safetensors` sha256 | `
|
| 40 |
|
| 41 |
`census/model.json` in the source repository holds the same names and hashes, and a test fails
|
| 42 |
when this card and that file disagree.
|
| 43 |
|
| 44 |
## What it does
|
| 45 |
|
| 46 |
-
The model
|
| 47 |
-
|
| 48 |
|
| 49 |
```text
|
| 50 |
-
[CLS]
|
| 51 |
```
|
| 52 |
|
| 53 |
The author text is the name, the ways a statement may write its initials, and the place in the
|
| 54 |
-
byline (`encoder.author_text` in `src/census/encoder.py`). The
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
|
| 60 |
-
|
| 61 |
-
`marker_positions` [batch, authors] (the index of each author's marker in `input_ids`), and gives
|
| 62 |
-
`logits` [batch, authors, 14].
|
| 63 |
-
|
| 64 |
-
A byline too long to fit 1,024 tokens beside the statement is split into chunks of authors, and
|
| 65 |
-
each chunk repeats the statement; every author keeps its "author i of n" text. A statement longer
|
| 66 |
-
than 1,024 tokens less a quarter for authors is cut to make room for them (`onepass.chunks` and
|
| 67 |
-
`onepass.statement_room` in `src/census/onepass.py`).
|
| 68 |
|
| 69 |
## How to use
|
| 70 |
|
| 71 |
The repository holds the PyTorch weights (`model.safetensors`) and two ONNX copies:
|
| 72 |
-
`onnx/model.onnx` (fp32) and `onnx/
|
| 73 |
-
`
|
| 74 |
|
| 75 |
```python
|
| 76 |
import json, re
|
|
@@ -91,43 +83,21 @@ def initials(name):
|
|
| 91 |
|
| 92 |
|
| 93 |
tokenizer = Tokenizer.from_file(hf_hub_download(REPO, "tokenizer.json"))
|
| 94 |
-
|
|
|
|
| 95 |
config = json.load(open(hf_hub_download(REPO, "config.json")))
|
| 96 |
-
run = json.load(open(hf_hub_download(REPO, "run.json")))
|
| 97 |
roles = [config["id2label"][str(i)] for i in range(len(config["id2label"]))]
|
| 98 |
threshold = json.load(open(hf_hub_download(REPO, "best.json")))["threshold"]
|
| 99 |
-
CLS, SEP, MARK = (tokenizer.token_to_id(t) for t in ("[CLS]", "[SEP]", run["marker"]))
|
| 100 |
-
MAX = run["max_length"]
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
def ids(text):
|
| 104 |
-
return tokenizer.encode(text, add_special_tokens=False).ids
|
| 105 |
|
| 106 |
|
| 107 |
def read(statement, authors):
|
| 108 |
-
n = len(authors)
|
| 109 |
-
texts = [ids(f"{a} ({', '.join(initials(a))}); author {i} of {n}")[: MAX // 4] for i, a in enumerate(authors, 1)]
|
| 110 |
-
need = [1 + len(t) for t in texts]
|
| 111 |
-
words = ids(statement)[: MAX - 3 - min(sum(need), max(max(need), MAX // 4))]
|
| 112 |
-
room, chunks = MAX - 3 - len(words), [[]]
|
| 113 |
-
for i, k in enumerate(need):
|
| 114 |
-
if chunks[-1] and sum(need[j] for j in chunks[-1]) + k > room:
|
| 115 |
-
chunks.append([])
|
| 116 |
-
chunks[-1].append(i)
|
| 117 |
pairs = set()
|
| 118 |
-
for
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
inputs = {
|
| 125 |
-
"input_ids": np.array([tokens]),
|
| 126 |
-
"attention_mask": np.ones((1, len(tokens)), dtype=np.int64),
|
| 127 |
-
"marker_positions": np.array([marks]),
|
| 128 |
-
}
|
| 129 |
-
for i, row in zip(chunk, session.run(None, inputs)[0][0]):
|
| 130 |
-
pairs |= {(i + 1, roles[r]) for r, p in enumerate(1 / (1 + np.exp(-row))) if p >= threshold}
|
| 131 |
return pairs
|
| 132 |
|
| 133 |
|
|
@@ -135,10 +105,13 @@ statement = "A.L. designed the study and wrote the first draft. C.D. analysed th
|
|
| 135 |
print(read(statement, ["Ada Lovelace", "Charles Darwin"]))
|
| 136 |
```
|
| 137 |
|
| 138 |
-
In
|
| 139 |
-
`
|
| 140 |
-
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
## Intended use
|
| 144 |
|
|
@@ -198,24 +171,24 @@ No article in the evaluation sets below is in the training data.
|
|
| 198 |
| Setting | Value |
|
| 199 |
| --- | --- |
|
| 200 |
| Base model | `jhu-clsp/ettin-encoder-68m` at `ac19ae4bc51093b31c475665ac872a936d056cc2` |
|
| 201 |
-
|
|
| 202 |
-
| Articles | 166,567 (163,266 after the CC BY / CC0 filter; 164,484 chunks, 801 articles split) |
|
| 203 |
| Epochs | 1 |
|
| 204 |
| Learning rate | 3e-5, linear decay, warm-up over the first 6% of steps |
|
| 205 |
-
| Batch size |
|
| 206 |
| Weight decay | 0.01 |
|
| 207 |
-
| Loss | binary cross-entropy over the 14 roles
|
| 208 |
| Max length | 1,024 tokens |
|
| 209 |
-
| Seed |
|
| 210 |
-
| Hardware | one RTX 4090, bf16;
|
| 211 |
-
| Time |
|
| 212 |
-
| Libraries | torch 2.15.0, transformers 5.
|
| 213 |
|
| 214 |
-
Every setting is in `run.json` beside the weights (`
|
| 215 |
|
| 216 |
-
**Energy.**
|
| 217 |
-
|
| 218 |
-
|
|
|
|
| 219 |
|
| 220 |
## Evaluation
|
| 221 |
|
|
@@ -238,55 +211,70 @@ used:
|
|
| 238 |
|
| 239 |
| | narrative F1 | narrative exact | CRediT F1 | CRediT exact |
|
| 240 |
| --- | --- | --- | --- | --- |
|
| 241 |
-
| this model, PyTorch | 0.
|
| 242 |
-
| this model,
|
| 243 |
-
| previous per-author model (`ettin-68m-both-s1`), PyTorch | 0.961 (0.944 to 0.975) | 0.59 | 0.973 (0.960 to 0.984) | 0.74 |
|
| 244 |
-
| previous per-author model, int8 ONNX | 0.960 (0.944 to 0.975) | 0.57 | 0.971 (0.956 to 0.984) | 0.73 |
|
| 245 |
| rule parser | 0.000 | 0.00 | 0.860 (0.800 to 0.910) | 0.56 |
|
| 246 |
|
| 247 |
-
`test200b` was scored once for this model, after it was chosen on gold500b.
|
| 248 |
-
|
| 249 |
The rule parser reads only CRediT names, so it finds nothing in narrative statements by design.
|
| 250 |
The three labellers agreed exactly with each other on 85% to 91% of narrative articles and 94% to
|
| 251 |
-
96% of CRediT articles. The model's exact scores (
|
| 252 |
pairs right, but often one pair per article wrong.
|
| 253 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
### Dev set used for model choice
|
| 255 |
|
| 256 |
`gold500b`: 500 articles (239 narrative, 261 CRediT). Every candidate run was scored on it, so
|
| 257 |
these scores are optimistic. Its narrative stratum is harder than the test set's: it holds the
|
| 258 |
statements an earlier labelling marked as having no CRediT roles.
|
| 259 |
|
| 260 |
-
| | narrative F1 |
|
| 261 |
-
| --- | --- | --- |
|
| 262 |
-
| this model (seed
|
| 263 |
-
| same recipe, seed
|
| 264 |
-
|
|
| 265 |
-
|
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
int8
|
| 283 |
-
|
| 284 |
-
### Speed
|
| 285 |
-
|
| 286 |
-
In Chromium with 4 threads on eight desktop cores, 20 authors: the one-pass w8 copy reads a
|
| 287 |
-
164-token statement in 0.80 to 0.90 s and a long statement (2 chunks) in 2.8 to 3.5 s. The previous
|
| 288 |
-
per-author int8 model took 2.5 to 2.7 s and 21.6 to 24.0 s. The model loads in 2.8 s cold and
|
| 289 |
-
1.1 s from the cache.
|
| 290 |
|
| 291 |
## Limitations
|
| 292 |
|
|
@@ -298,13 +286,14 @@ per-author int8 model took 2.5 to 2.7 s and 21.6 to 24.0 s. The model loads in 2
|
|
| 298 |
surname. Bylines in other orders, and statements with swapped or misspelled initials, depend on
|
| 299 |
the model reading the name itself.
|
| 300 |
- **Biomedical sources.** Europe PMC is biomedical by construction, and Frontiers and MDPI lead the
|
| 301 |
-
training data.
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
|
|
|
| 308 |
|
| 309 |
## Licence
|
| 310 |
|
|
|
|
| 2 |
license: mit
|
| 3 |
base_model: jhu-clsp/ettin-encoder-68m
|
| 4 |
base_model_relation: finetune
|
| 5 |
+
library_name: transformers.js
|
| 6 |
pipeline_tag: text-classification
|
| 7 |
language:
|
| 8 |
- en
|
|
|
|
| 25 |
[CRediT census](https://github.com/simonvanlierde/credit-matrix/tree/main/census) in
|
| 26 |
[CRediT Matrix](https://github.com/simonvanlierde/credit-matrix).
|
| 27 |
It is [Ettin-68M](https://huggingface.co/jhu-clsp/ettin-encoder-68m) (revision
|
| 28 |
+
`ac19ae4bc51093b31c475665ac872a936d056cc2`), fine-tuned on 166,567 statements.
|
|
|
|
| 29 |
Source paths below are in the
|
| 30 |
[census code](https://github.com/simonvanlierde/credit-matrix/tree/main/census/src/census).
|
| 31 |
|
| 32 |
| | |
|
| 33 |
| --- | --- |
|
| 34 |
+
| Run | `ettin-68m-both-s1` |
|
| 35 |
| Hub repository | [`simonvanlierde/credit-statement-reader`](https://huggingface.co/simonvanlierde/credit-statement-reader) |
|
| 36 |
+
| `onnx/model_int8.onnx` sha256 | `0157d52635f2a0a5482591ef525a40ddaac02b5ecb774587f945480b4a6b67ee` |
|
| 37 |
+
| `onnx/model.onnx` sha256 | `ea66c786ba8d7fa33a490f707444a62f6e2589420b963afd129bc27440b85530` |
|
| 38 |
+
| `model.safetensors` sha256 | `a48dff938802fef29959e193d2ed7c3a5bd6ca3a3ae1fef6ff5f308f128e8e86` |
|
| 39 |
|
| 40 |
`census/model.json` in the source repository holds the same names and hashes, and a test fails
|
| 41 |
when this card and that file disagree.
|
| 42 |
|
| 43 |
## What it does
|
| 44 |
|
| 45 |
+
The model classifies one author at a time. Each input is a pair: a short author text, then the
|
| 46 |
+
statement.
|
| 47 |
|
| 48 |
```text
|
| 49 |
+
[CLS] Na-Gyeong Ryu (N.-G.R., NGR, Ryu NG); author 2 of 5 [SEP] <statement> [SEP]
|
| 50 |
```
|
| 51 |
|
| 52 |
The author text is the name, the ways a statement may write its initials, and the place in the
|
| 53 |
+
byline (`encoder.author_text` in `src/census/encoder.py`). The head is a sequence classifier
|
| 54 |
+
with 14 outputs and a sigmoid on each, one yes or no per role. The config names the outputs by
|
| 55 |
+
role in `id2label`. A role counts when its probability is at or above 0.4, the threshold that
|
| 56 |
+
scored best on the dev set. The threshold is in `best.json` beside the weights, because the model
|
| 57 |
+
config does not hold it. Run the model once per author and the answers are (author, role) pairs.
|
| 58 |
|
| 59 |
+
Inputs are cut at 1,024 tokens, as in training.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
## How to use
|
| 62 |
|
| 63 |
The repository holds the PyTorch weights (`model.safetensors`) and two ONNX copies:
|
| 64 |
+
`onnx/model.onnx` (fp32) and `onnx/model_int8.onnx` (int8). In Python, with `onnxruntime`,
|
| 65 |
+
`tokenizers` and `huggingface_hub`:
|
| 66 |
|
| 67 |
```python
|
| 68 |
import json, re
|
|
|
|
| 83 |
|
| 84 |
|
| 85 |
tokenizer = Tokenizer.from_file(hf_hub_download(REPO, "tokenizer.json"))
|
| 86 |
+
tokenizer.enable_truncation(1024, strategy="only_second")
|
| 87 |
+
session = ort.InferenceSession(hf_hub_download(REPO, "onnx/model_int8.onnx"))
|
| 88 |
config = json.load(open(hf_hub_download(REPO, "config.json")))
|
|
|
|
| 89 |
roles = [config["id2label"][str(i)] for i in range(len(config["id2label"]))]
|
| 90 |
threshold = json.load(open(hf_hub_download(REPO, "best.json")))["threshold"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
| 93 |
def read(statement, authors):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
pairs = set()
|
| 95 |
+
for i, name in enumerate(authors, 1):
|
| 96 |
+
text = f"{name} ({', '.join(initials(name))}); author {i} of {len(authors)}"
|
| 97 |
+
enc = tokenizer.encode(text, statement)
|
| 98 |
+
inputs = {"input_ids": np.array([enc.ids]), "attention_mask": np.array([enc.attention_mask])}
|
| 99 |
+
logits = session.run(None, inputs)[0][0]
|
| 100 |
+
pairs |= {(i, roles[r]) for r, p in enumerate(1 / (1 + np.exp(-logits))) if p >= threshold}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
return pairs
|
| 102 |
|
| 103 |
|
|
|
|
| 105 |
print(read(statement, ["Ada Lovelace", "Charles Darwin"]))
|
| 106 |
```
|
| 107 |
|
| 108 |
+
In transformers.js, load it with
|
| 109 |
+
`AutoModelForSequenceClassification.from_pretrained(REPO, { dtype: "int8" })`.
|
| 110 |
+
|
| 111 |
+
A role whose probability sits near the threshold can flip between runtimes and batch sizes, because
|
| 112 |
+
the int8 copy quantises activations per batch. Reading one author at a time, as the snippet
|
| 113 |
+
does, the int8 copy gave the same pairs as the batched evaluation on 37 of 40 test articles. The fp32 copy gave the
|
| 114 |
+
same pairs as the PyTorch model on 39 of 40.
|
| 115 |
|
| 116 |
## Intended use
|
| 117 |
|
|
|
|
| 171 |
| Setting | Value |
|
| 172 |
| --- | --- |
|
| 173 |
| Base model | `jhu-clsp/ettin-encoder-68m` at `ac19ae4bc51093b31c475665ac872a936d056cc2` |
|
| 174 |
+
| Articles | 166,567 |
|
|
|
|
| 175 |
| Epochs | 1 |
|
| 176 |
| Learning rate | 3e-5, linear decay, warm-up over the first 6% of steps |
|
| 177 |
+
| Batch size | 32 |
|
| 178 |
| Weight decay | 0.01 |
|
| 179 |
+
| Loss | binary cross-entropy over the 14 roles |
|
| 180 |
| Max length | 1,024 tokens |
|
| 181 |
+
| Seed | 1 |
|
| 182 |
+
| Hardware | one RTX 4090, bf16; 14.0 GB of GPU memory at most |
|
| 183 |
+
| Time | 1,654 s |
|
| 184 |
+
| Libraries | torch 2.15.0, transformers 5.20.2 |
|
| 185 |
|
| 186 |
+
Every setting is in `run.json` beside the weights (`encoder.Config`).
|
| 187 |
|
| 188 |
+
**Energy.** Training energy was not metered. Assuming about 0.5 kW for the RTX 4090 and its host,
|
| 189 |
+
1,654 s is about 0.23 kWh. At the Dutch grid average that the census uses for its metered runs
|
| 190 |
+
(0.27 kg CO2e per kWh), that is about 0.06 kg CO2e. The model search behind this run took about
|
| 191 |
+
100 training runs of similar size, so roughly 100 times that.
|
| 192 |
|
| 193 |
## Evaluation
|
| 194 |
|
|
|
|
| 211 |
|
| 212 |
| | narrative F1 | narrative exact | CRediT F1 | CRediT exact |
|
| 213 |
| --- | --- | --- | --- | --- |
|
| 214 |
+
| this model, PyTorch | 0.961 (0.944 to 0.975) | 0.59 | 0.973 (0.960 to 0.984) | 0.74 |
|
| 215 |
+
| this model, int8 ONNX | 0.960 (0.944 to 0.975) | 0.57 | 0.971 (0.956 to 0.984) | 0.73 |
|
|
|
|
|
|
|
| 216 |
| rule parser | 0.000 | 0.00 | 0.860 (0.800 to 0.910) | 0.56 |
|
| 217 |
|
|
|
|
|
|
|
| 218 |
The rule parser reads only CRediT names, so it finds nothing in narrative statements by design.
|
| 219 |
The three labellers agreed exactly with each other on 85% to 91% of narrative articles and 94% to
|
| 220 |
+
96% of CRediT articles. The model's exact scores (59% and 74%) sit well below that: it gets most
|
| 221 |
pairs right, but often one pair per article wrong.
|
| 222 |
|
| 223 |
+
Per role on the test set, F1 is 0.87 or more for every role except narrative validation (0.80,
|
| 224 |
+
21 gold pairs). Small roles have wide intervals: visualization has 10 narrative gold pairs,
|
| 225 |
+
funding acquisition 11.
|
| 226 |
+
|
| 227 |
+
### Outside biomedicine
|
| 228 |
+
|
| 229 |
+
`ood200b`: 147 CC BY / CC0 articles from 2022 on, drawn on 2026-11-23 from publishers outside Europe
|
| 230 |
+
PMC: Copernicus (40), Pensoft (40), Scientific Research Publishing (SRP, 40), Frontiers (25) and Open
|
| 231 |
+
Research Europe (2); about half are earth science. 71 statements are narrative and 76 use CRediT names.
|
| 232 |
+
They were labelled as the test set was, and a person ruled on the 5 rows where all three labellers
|
| 233 |
+
differed.
|
| 234 |
+
|
| 235 |
+
| | narrative F1 | narrative exact | CRediT F1 | CRediT exact |
|
| 236 |
+
| --- | --- | --- | --- | --- |
|
| 237 |
+
| this model, PyTorch | 0.894 (0.863 to 0.925) | 0.41 | 0.951 (0.922 to 0.973) | 0.68 |
|
| 238 |
+
| this model, int8 ONNX, one author at a time | 0.884 (0.854 to 0.914) | 0.35 | 0.949 (0.920 to 0.972) | 0.66 |
|
| 239 |
+
| rule parser | 0.000 | 0.17 | 0.857 (0.799 to 0.907) | 0.49 |
|
| 240 |
+
|
| 241 |
+
Narrative statements score clearly lower than in the test set (0.894 against 0.961). CRediT
|
| 242 |
+
statements hold up once SRP is left out (0.970 on the other 56), and narrative rises only to 0.909
|
| 243 |
+
without SRP, whose statements are often loosely worded. The labellers also agreed less: 78% to 82% of
|
| 244 |
+
narrative articles and 87% to 95% of CRediT articles. Training on 269 more narrative statements from
|
| 245 |
+
these publishers (Pensoft left out) did not close the gap over two seeds. OpenAlex's role data, which
|
| 246 |
+
reads CRediT names in full text, has roles for 43 of the 76 CRediT articles and none of the narrative
|
| 247 |
+
ones; on those 43 this model scores F1 0.968 and OpenAlex 0.899 (checked 2026-11-26).
|
| 248 |
+
|
| 249 |
### Dev set used for model choice
|
| 250 |
|
| 251 |
`gold500b`: 500 articles (239 narrative, 261 CRediT). Every candidate run was scored on it, so
|
| 252 |
these scores are optimistic. Its narrative stratum is harder than the test set's: it holds the
|
| 253 |
statements an earlier labelling marked as having no CRediT roles.
|
| 254 |
|
| 255 |
+
| | narrative F1 | CRediT F1 |
|
| 256 |
+
| --- | --- | --- |
|
| 257 |
+
| this model (seed 1) | 0.930 (0.910 to 0.947) | 0.976 (0.963 to 0.986) |
|
| 258 |
+
| same recipe, seed 2 | 0.928 | 0.975 |
|
| 259 |
+
| int8 ONNX | 0.927 | 0.975 |
|
| 260 |
+
| rule parser | 0.069 | 0.903 |
|
| 261 |
+
|
| 262 |
+
On gold500b the weakest narrative roles are data curation (0.74, 75 gold pairs), software (0.79,
|
| 263 |
+
57) and validation (0.83, 66).
|
| 264 |
+
|
| 265 |
+
### int8 against fp32
|
| 266 |
+
|
| 267 |
+
On 2,000 held-out articles scored against publisher tags, fp32, int8 and q4 ONNX all reach F1 0.904.
|
| 268 |
+
int8 gives exactly the same pairs as fp32 on 95.1% of those articles. On gold500b the share is 74.0%
|
| 269 |
+
(61.5% narrative), because narrative statements put more probabilities near the threshold. Paired
|
| 270 |
+
against the PyTorch model on gold500b, int8 changes narrative F1 by -0.003 (95% interval -0.009 to
|
| 271 |
+
+0.003) and CRediT F1 by -0.001 (-0.003 to +0.002); q4 loses 0.004 on narrative, with an interval
|
| 272 |
+
below zero. Exact match falls further. Reading one author at a time, as the app does, int8 matches
|
| 273 |
+
the gold labels on whole CRediT articles of gold500b 0.793 of the time against 0.812 for PyTorch
|
| 274 |
+
(-0.019, 95% interval -0.038 to -0.004). On narrative articles it is 0.473 against 0.510 (-0.038,
|
| 275 |
+
-0.075 to +0.000), a borderline drop. A single threshold fitted to int8 on the 2,000-article dev set
|
| 276 |
+
(0.34) does not win this back, and CRediT exact match stays down under every threshold variant
|
| 277 |
+
tried. int8 is a quarter of the size (70 MB against 275 MB), so it is the copy the app loads.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
|
| 279 |
## Limitations
|
| 280 |
|
|
|
|
| 286 |
surname. Bylines in other orders, and statements with swapped or misspelled initials, depend on
|
| 287 |
the model reading the name itself.
|
| 288 |
- **Biomedical sources.** Europe PMC is biomedical by construction, and Frontiers and MDPI lead the
|
| 289 |
+
training data. Outside biomedicine, narrative statements score about 0.07 F1 lower (see
|
| 290 |
+
[Outside biomedicine](#outside-biomedicine)).
|
| 291 |
+
- **Labels.** The gold sets were made by language-model labellers with a vote and an adjudicator. A
|
| 292 |
+
person checked 40 rows of the pilot set (36 right) and ruled on 4 of 40 sampled gold500b rows,
|
| 293 |
+
which changed the definition. Nobody checked the test set by hand; a person ruled on the 5 split
|
| 294 |
+
rows of ood200b. Part of the training data comes from publisher tags, which can name roles a
|
| 295 |
+
statement never gives.
|
| 296 |
+
- **Long statements.** Statements over 1,024 tokens are cut.
|
| 297 |
|
| 298 |
## Licence
|
| 299 |
|
best.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"epoch": 1,
|
| 3 |
"threshold": 0.4,
|
| 4 |
-
"precision": 0.
|
| 5 |
-
"recall": 0.
|
| 6 |
-
"f1": 0.
|
| 7 |
-
"exact": 0.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"epoch": 1,
|
| 3 |
"threshold": 0.4,
|
| 4 |
+
"precision": 0.93,
|
| 5 |
+
"recall": 0.963,
|
| 6 |
+
"f1": 0.946,
|
| 7 |
+
"exact": 0.701
|
| 8 |
}
|
config.json
CHANGED
|
@@ -104,6 +104,6 @@
|
|
| 104 |
"sparse_pred_ignore_index": -100,
|
| 105 |
"sparse_prediction": false,
|
| 106 |
"tie_word_embeddings": true,
|
| 107 |
-
"transformers_version": "5.
|
| 108 |
"vocab_size": 50368
|
| 109 |
}
|
|
|
|
| 104 |
"sparse_pred_ignore_index": -100,
|
| 105 |
"sparse_prediction": false,
|
| 106 |
"tie_word_embeddings": true,
|
| 107 |
+
"transformers_version": "5.20.2",
|
| 108 |
"vocab_size": 50368
|
| 109 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 273670208
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a48dff938802fef29959e193d2ed7c3a5bd6ca3a3ae1fef6ff5f308f128e8e86
|
| 3 |
size 273670208
|
onnx/model.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ea66c786ba8d7fa33a490f707444a62f6e2589420b963afd129bc27440b85530
|
| 3 |
+
size 275281398
|
run.json
CHANGED
|
@@ -5,14 +5,12 @@
|
|
| 5 |
"dev_articles": 2000,
|
| 6 |
"dev_every": 50,
|
| 7 |
"max_length": 1024,
|
| 8 |
-
"batch_size":
|
| 9 |
"epochs": 1,
|
| 10 |
-
"learning_rate":
|
| 11 |
"weight_decay": 0.01,
|
| 12 |
"warmup_share": 0.06,
|
| 13 |
-
"seed":
|
| 14 |
"open_licence_only": true,
|
| 15 |
-
"device": "cuda"
|
| 16 |
-
"init": "ettin-68m-both-s1",
|
| 17 |
-
"marker": "[unused0]"
|
| 18 |
}
|
|
|
|
| 5 |
"dev_articles": 2000,
|
| 6 |
"dev_every": 50,
|
| 7 |
"max_length": 1024,
|
| 8 |
+
"batch_size": 32,
|
| 9 |
"epochs": 1,
|
| 10 |
+
"learning_rate": 3e-05,
|
| 11 |
"weight_decay": 0.01,
|
| 12 |
"warmup_share": 0.06,
|
| 13 |
+
"seed": 1,
|
| 14 |
"open_licence_only": true,
|
| 15 |
+
"device": "cuda"
|
|
|
|
|
|
|
| 16 |
}
|
tokenizer_config.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"clean_up_tokenization_spaces": true,
|
| 4 |
"cls_token": "[CLS]",
|
| 5 |
-
"is_local":
|
| 6 |
"local_files_only": false,
|
| 7 |
"mask_token": "[MASK]",
|
| 8 |
"model_input_names": [
|
|
|
|
| 2 |
"backend": "tokenizers",
|
| 3 |
"clean_up_tokenization_spaces": true,
|
| 4 |
"cls_token": "[CLS]",
|
| 5 |
+
"is_local": false,
|
| 6 |
"local_files_only": false,
|
| 7 |
"mask_token": "[MASK]",
|
| 8 |
"model_input_names": [
|