Upload SIMPLE checkpoint (converted from paper checkpoint)
Browse files- README.md +99 -0
- config.json +98 -0
- model.safetensors +3 -0
- tokenizer/added_tokens.json +3 -0
- tokenizer/special_tokens_map.json +51 -0
- tokenizer/spm.model +3 -0
- tokenizer/tokenizer.json +0 -0
- tokenizer/tokenizer_config.json +59 -0
README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: simple-metric
|
| 6 |
+
base_model: microsoft/deberta-v3-large
|
| 7 |
+
tags:
|
| 8 |
+
- text-simplification
|
| 9 |
+
- evaluation
|
| 10 |
+
- metric
|
| 11 |
+
- reference-free
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# SIMPLE-large
|
| 15 |
+
|
| 16 |
+
**SIMPLE** (SImplicity Metric via Preference LEarning) is a reference-free learned metric
|
| 17 |
+
for sentence simplification. For a source sentence and a candidate simplification it returns
|
| 18 |
+
|
| 19 |
+
- a **score** `mu` in (-1, 1): +1 = highly successful simplification, 0 = verbatim copy of
|
| 20 |
+
the source, -1 = unrelated or degenerate text (negative = unsuccessful, including
|
| 21 |
+
complexifications);
|
| 22 |
+
- an **uncertainty** `sigma` (> 0.05): the model's confidence in that score. Lower sigma
|
| 23 |
+
means more reliable; it is a confidence signal, not an estimate of human disagreement.
|
| 24 |
+
|
| 25 |
+
This is the `large` model (microsoft/deberta-v3-large cross-encoder). Sizes: small, base, large.
|
| 26 |
+
|
| 27 |
+
## Usage
|
| 28 |
+
|
| 29 |
+
```bash
|
| 30 |
+
pip install simple-metric
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
from simple_metric import SIMPLE
|
| 35 |
+
|
| 36 |
+
metric = SIMPLE.from_pretrained("large") # = "mpapucci/simple-metric-large"
|
| 37 |
+
out = metric.score(
|
| 38 |
+
["The feline perched upon the mat in a state of repose."],
|
| 39 |
+
["The cat sat on the mat."],
|
| 40 |
+
)
|
| 41 |
+
print(out.mu, out.sigma)
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
From the command line: `simple-metric score --model large --sources src.txt --candidates sys.txt`.
|
| 45 |
+
With Hugging Face `evaluate`: `evaluate.load("mpapucci/simple", "large")`.
|
| 46 |
+
|
| 47 |
+
## Results
|
| 48 |
+
|
| 49 |
+
SimpEval 2022 (Maddela et al., 2023): pairwise accuracy and Kendall tau over 484 human
|
| 50 |
+
preference pairs; Pearson/Spearman with 360 human ratings; adversarial beat-rate (genuine
|
| 51 |
+
simplification scored above a copy / truncation / shuffle / random sentence /
|
| 52 |
+
over-deletion of the source, averaged).
|
| 53 |
+
|
| 54 |
+
| Pairwise acc. | Kendall tau | Pearson | Spearman | Beat-rate |
|
| 55 |
+
|---|---|---|---|---|
|
| 56 |
+
| 0.814 | 0.628 | 0.391 | 0.454 | 0.989 |
|
| 57 |
+
|
| 58 |
+
Pearson correlation with human ratings on Simplicity-DA (Alva-Manchego et al., 2021) and
|
| 59 |
+
Structural Simplicity (Sulem et al., 2018):
|
| 60 |
+
|
| 61 |
+
| SDA fluency | SDA meaning | SDA simplicity | SS grammaticality | SS meaning | SS simplicity | SS structural |
|
| 62 |
+
|---|---|---|---|---|---|---|
|
| 63 |
+
| .665 | .588 | .695 | .374 | -.069 | .531 | .461 |
|
| 64 |
+
|
| 65 |
+
Mean (std) score on SimpEval 2022: genuine simplifications +.66 (.25), complexifications
|
| 66 |
+
(source and simplification swapped) -.68 (.19), adversarial candidates -.56 (.34).
|
| 67 |
+
|
| 68 |
+
The checkpoint was selected by pairwise accuracy on SimpEval 2022, the same data as the
|
| 69 |
+
first table, so those numbers are optimistic; the other benchmarks were not used for
|
| 70 |
+
selection.
|
| 71 |
+
|
| 72 |
+
## Training
|
| 73 |
+
|
| 74 |
+
A cross-encoder over `[CLS] source [SEP] candidate [SEP]` with two linear heads,
|
| 75 |
+
`mu = tanh(W h)` and `sigma = softplus(W' h) + 0.05`, trained with
|
| 76 |
+
|
| 77 |
+
- a Thurstone (Case III) pairwise loss, `-log Phi((mu_pos - mu_neg - m) / sqrt(sigma_pos^2 + sigma_neg^2))`,
|
| 78 |
+
on 507,940 preference pairs built from ASSET, OneStopEnglish, Newsela and SimpEval PAST
|
| 79 |
+
(original vs. simplification, more vs. less simplified, human-preferred vs. dispreferred
|
| 80 |
+
with rating margin `m`, simplification vs. unrelated sentence);
|
| 81 |
+
- a Gaussian negative log-likelihood (weight 0.7) on 2,400 SimpEval PAST human ratings plus
|
| 82 |
+
synthetic anchors (copies = 0, degenerate rewrites < 0, unrelated text = -1).
|
| 83 |
+
|
| 84 |
+
Hyperparameters: AdamW, learning rate 1e-5, batch 8, 5 epochs over a random quarter of the
|
| 85 |
+
pairs per epoch, linear warmup over 6% of steps, max length 512. The training code and a
|
| 86 |
+
recipe to rebuild the data from the original sources are in the
|
| 87 |
+
[simple-metric repository](https://github.com/michelepapucci/simple-metric).
|
| 88 |
+
|
| 89 |
+
## Limitations
|
| 90 |
+
|
| 91 |
+
- Sentence-level, English, mostly news and Wikipedia; behaviour may differ in other
|
| 92 |
+
domains or for other reader populations.
|
| 93 |
+
- Insertion/elaboration-heavy simplifications are rare in the training data; both `mu` and
|
| 94 |
+
`sigma` are less reliable on them.
|
| 95 |
+
- `sigma` is reasonably but not perfectly calibrated (temperature scaling helps).
|
| 96 |
+
|
| 97 |
+
## Citation
|
| 98 |
+
|
| 99 |
+
Citation will be added upon publication.
|
config.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"encoder": {
|
| 3 |
+
"add_cross_attention": false,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"DebertaV2Model"
|
| 6 |
+
],
|
| 7 |
+
"attention_probs_dropout_prob": 0.1,
|
| 8 |
+
"bad_words_ids": null,
|
| 9 |
+
"begin_suppress_tokens": null,
|
| 10 |
+
"bos_token_id": null,
|
| 11 |
+
"chunk_size_feed_forward": 0,
|
| 12 |
+
"cross_attention_hidden_size": null,
|
| 13 |
+
"decoder_start_token_id": null,
|
| 14 |
+
"diversity_penalty": 0.0,
|
| 15 |
+
"do_sample": false,
|
| 16 |
+
"dtype": "float32",
|
| 17 |
+
"early_stopping": false,
|
| 18 |
+
"encoder_no_repeat_ngram_size": 0,
|
| 19 |
+
"eos_token_id": null,
|
| 20 |
+
"exponential_decay_length_penalty": null,
|
| 21 |
+
"finetuning_task": null,
|
| 22 |
+
"forced_bos_token_id": null,
|
| 23 |
+
"forced_eos_token_id": null,
|
| 24 |
+
"hidden_act": "gelu",
|
| 25 |
+
"hidden_dropout_prob": 0.1,
|
| 26 |
+
"hidden_size": 1024,
|
| 27 |
+
"id2label": {
|
| 28 |
+
"0": "LABEL_0",
|
| 29 |
+
"1": "LABEL_1"
|
| 30 |
+
},
|
| 31 |
+
"initializer_range": 0.02,
|
| 32 |
+
"intermediate_size": 4096,
|
| 33 |
+
"is_decoder": false,
|
| 34 |
+
"is_encoder_decoder": false,
|
| 35 |
+
"label2id": {
|
| 36 |
+
"LABEL_0": 0,
|
| 37 |
+
"LABEL_1": 1
|
| 38 |
+
},
|
| 39 |
+
"layer_norm_eps": 1e-07,
|
| 40 |
+
"legacy": true,
|
| 41 |
+
"length_penalty": 1.0,
|
| 42 |
+
"max_length": 20,
|
| 43 |
+
"max_position_embeddings": 512,
|
| 44 |
+
"max_relative_positions": -1,
|
| 45 |
+
"min_length": 0,
|
| 46 |
+
"model_type": "deberta-v2",
|
| 47 |
+
"no_repeat_ngram_size": 0,
|
| 48 |
+
"norm_rel_ebd": "layer_norm",
|
| 49 |
+
"num_attention_heads": 16,
|
| 50 |
+
"num_beam_groups": 1,
|
| 51 |
+
"num_beams": 1,
|
| 52 |
+
"num_hidden_layers": 24,
|
| 53 |
+
"num_return_sequences": 1,
|
| 54 |
+
"output_attentions": false,
|
| 55 |
+
"output_hidden_states": false,
|
| 56 |
+
"output_scores": false,
|
| 57 |
+
"pad_token_id": 0,
|
| 58 |
+
"pooler_dropout": 0.0,
|
| 59 |
+
"pooler_hidden_act": "gelu",
|
| 60 |
+
"pooler_hidden_size": 1024,
|
| 61 |
+
"pos_att_type": [
|
| 62 |
+
"p2c",
|
| 63 |
+
"c2p"
|
| 64 |
+
],
|
| 65 |
+
"position_biased_input": false,
|
| 66 |
+
"position_buckets": 256,
|
| 67 |
+
"prefix": null,
|
| 68 |
+
"problem_type": null,
|
| 69 |
+
"pruned_heads": {},
|
| 70 |
+
"relative_attention": true,
|
| 71 |
+
"remove_invalid_values": false,
|
| 72 |
+
"repetition_penalty": 1.0,
|
| 73 |
+
"return_dict": true,
|
| 74 |
+
"return_dict_in_generate": false,
|
| 75 |
+
"sep_token_id": null,
|
| 76 |
+
"share_att_key": true,
|
| 77 |
+
"suppress_tokens": null,
|
| 78 |
+
"task_specific_params": null,
|
| 79 |
+
"temperature": 1.0,
|
| 80 |
+
"tf_legacy_loss": false,
|
| 81 |
+
"tie_encoder_decoder": false,
|
| 82 |
+
"tie_word_embeddings": true,
|
| 83 |
+
"tokenizer_class": null,
|
| 84 |
+
"top_k": 50,
|
| 85 |
+
"top_p": 1.0,
|
| 86 |
+
"torch_dtype": "float32",
|
| 87 |
+
"torchscript": false,
|
| 88 |
+
"type_vocab_size": 0,
|
| 89 |
+
"typical_p": 1.0,
|
| 90 |
+
"use_bfloat16": false,
|
| 91 |
+
"vocab_size": 128100
|
| 92 |
+
},
|
| 93 |
+
"format_version": 1,
|
| 94 |
+
"max_length": 512,
|
| 95 |
+
"model_type": "simple",
|
| 96 |
+
"sigma_floor": 0.05,
|
| 97 |
+
"simple_metric_version": "0.1.0"
|
| 98 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c3d178da39127c5b4cc7ea06f08a0816b033f1efcfcd0ead884a013bf1ae4fb6
|
| 3 |
+
size 1736106048
|
tokenizer/added_tokens.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"[MASK]": 128000
|
| 3 |
+
}
|
tokenizer/special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "[CLS]",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "[CLS]",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "[SEP]",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "[MASK]",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "[PAD]",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "[SEP]",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "[UNK]",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": true,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
tokenizer/spm.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
|
| 3 |
+
size 2464616
|
tokenizer/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer/tokenizer_config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "[CLS]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "[SEP]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "[UNK]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": true,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"128000": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"bos_token": "[CLS]",
|
| 45 |
+
"clean_up_tokenization_spaces": false,
|
| 46 |
+
"cls_token": "[CLS]",
|
| 47 |
+
"do_lower_case": false,
|
| 48 |
+
"eos_token": "[SEP]",
|
| 49 |
+
"extra_special_tokens": {},
|
| 50 |
+
"mask_token": "[MASK]",
|
| 51 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 52 |
+
"pad_token": "[PAD]",
|
| 53 |
+
"sep_token": "[SEP]",
|
| 54 |
+
"sp_model_kwargs": {},
|
| 55 |
+
"split_by_punct": false,
|
| 56 |
+
"tokenizer_class": "DebertaV2Tokenizer",
|
| 57 |
+
"unk_token": "[UNK]",
|
| 58 |
+
"vocab_type": "spm"
|
| 59 |
+
}
|