Upload katana-guy model
Browse files- .gitattributes +1 -0
- README.md +42 -0
- config.json +63 -0
- labels.json +1 -0
- model.onnx +3 -0
- model.rknn +3 -0
- model.safetensors +3 -0
- scores.json +36 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
model.rknn filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model: distilbert/distilroberta-base
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
tags: [logical-fallacy, discord, onnx, rknn]
|
| 6 |
---
|
| 7 |
+
|
| 8 |
+
# katana-guy fallacy classifier
|
| 9 |
+
|
| 10 |
+
distilroberta-base fine-tuned to spot 14 logical fallacies (or `none`) in short chat messages.
|
| 11 |
+
Trained on [LOGIC](https://github.com/causalNLP/logical-fallacy), [CoCoLoFa](https://github.com/Crowd-AI-Lab/cocolofa)
|
| 12 |
+
and synthetic Discord-style messages.
|
| 13 |
+
|
| 14 |
+
| file | use |
|
| 15 |
+
| --- | --- |
|
| 16 |
+
| `model.safetensors`, `config.json`, tokenizer | `transformers`: `pipeline("text-classification", model="YaRusty/distilroberta-fallacy-classifier")` |
|
| 17 |
+
| `model.onnx` | ONNX Runtime, inputs `input_ids`, `attention_mask`, fixed shape [1, 128] |
|
| 18 |
+
| `model.rknn` | RK3588 NPU (rknn-toolkit-lite2 2.3.2), fp16, also takes `position_ids` |
|
| 19 |
+
|
| 20 |
+
## Test F1
|
| 21 |
+
|
| 22 |
+
"real" is the LOGIC + CoCoLoFa test split, "discord" a held-out slice of the synthetic messages.
|
| 23 |
+
|
| 24 |
+
| label | real | discord |
|
| 25 |
+
| --- | --- | --- |
|
| 26 |
+
| ad hominem | 0.69 | 0.63 |
|
| 27 |
+
| appeal to authority | 0.73 | 0.98 |
|
| 28 |
+
| appeal to emotion | 0.67 | 0.84 |
|
| 29 |
+
| appeal to majority | 0.78 | 0.86 |
|
| 30 |
+
| appeal to nature | 0.90 | 0.89 |
|
| 31 |
+
| appeal to tradition | 0.81 | 0.85 |
|
| 32 |
+
| appeal to worse problems | 0.78 | 0.72 |
|
| 33 |
+
| circular reasoning | 0.57 | 0.91 |
|
| 34 |
+
| false causality | 0.63 | 0.82 |
|
| 35 |
+
| false dilemma | 0.81 | 0.90 |
|
| 36 |
+
| hasty generalization | 0.60 | 0.91 |
|
| 37 |
+
| none | 0.76 | 0.90 |
|
| 38 |
+
| red herring | 0.42 | 0.81 |
|
| 39 |
+
| slippery slope | 0.77 | 0.88 |
|
| 40 |
+
| straw man | 0.74 | 0.95 |
|
| 41 |
+
|
| 42 |
+
## License
|
| 43 |
+
|
| 44 |
+
Apache-2.0, like the base model. LOGIC and CoCoLoFa are published without a license, so their terms
|
| 45 |
+
are not covered by it; check them with the dataset authors before commercial use.
|
config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"RobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 768,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "ad hominem",
|
| 16 |
+
"1": "appeal to authority",
|
| 17 |
+
"2": "appeal to emotion",
|
| 18 |
+
"3": "appeal to majority",
|
| 19 |
+
"4": "appeal to nature",
|
| 20 |
+
"5": "appeal to tradition",
|
| 21 |
+
"6": "appeal to worse problems",
|
| 22 |
+
"7": "circular reasoning",
|
| 23 |
+
"8": "false causality",
|
| 24 |
+
"9": "false dilemma",
|
| 25 |
+
"10": "hasty generalization",
|
| 26 |
+
"11": "none",
|
| 27 |
+
"12": "red herring",
|
| 28 |
+
"13": "slippery slope",
|
| 29 |
+
"14": "straw man"
|
| 30 |
+
},
|
| 31 |
+
"initializer_range": 0.02,
|
| 32 |
+
"intermediate_size": 3072,
|
| 33 |
+
"is_decoder": false,
|
| 34 |
+
"label2id": {
|
| 35 |
+
"ad hominem": 0,
|
| 36 |
+
"appeal to authority": 1,
|
| 37 |
+
"appeal to emotion": 2,
|
| 38 |
+
"appeal to majority": 3,
|
| 39 |
+
"appeal to nature": 4,
|
| 40 |
+
"appeal to tradition": 5,
|
| 41 |
+
"appeal to worse problems": 6,
|
| 42 |
+
"circular reasoning": 7,
|
| 43 |
+
"false causality": 8,
|
| 44 |
+
"false dilemma": 9,
|
| 45 |
+
"hasty generalization": 10,
|
| 46 |
+
"none": 11,
|
| 47 |
+
"red herring": 12,
|
| 48 |
+
"slippery slope": 13,
|
| 49 |
+
"straw man": 14
|
| 50 |
+
},
|
| 51 |
+
"layer_norm_eps": 1e-05,
|
| 52 |
+
"max_position_embeddings": 514,
|
| 53 |
+
"model_type": "roberta",
|
| 54 |
+
"num_attention_heads": 12,
|
| 55 |
+
"num_hidden_layers": 6,
|
| 56 |
+
"pad_token_id": 1,
|
| 57 |
+
"problem_type": "single_label_classification",
|
| 58 |
+
"tie_word_embeddings": true,
|
| 59 |
+
"transformers_version": "5.19.0",
|
| 60 |
+
"type_vocab_size": 1,
|
| 61 |
+
"use_cache": false,
|
| 62 |
+
"vocab_size": 50265
|
| 63 |
+
}
|
labels.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
["ad hominem", "appeal to authority", "appeal to emotion", "appeal to majority", "appeal to nature", "appeal to tradition", "appeal to worse problems", "circular reasoning", "false causality", "false dilemma", "hasty generalization", "none", "red herring", "slippery slope", "straw man"]
|
model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:def9b7162d8a444792c2dfb1db79c4355a818f79253fe4aceaad9314145ab253
|
| 3 |
+
size 328623715
|
model.rknn
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a58a0bd4a14b89d538e83595bfbcda4872528ed2c84f6b655d38b99be4d33508
|
| 3 |
+
size 166404477
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fde21da14f240ee4fc82078be0cd72bdf2cc9021a9d068cb62bc8457c2b11795
|
| 3 |
+
size 328532268
|
scores.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"real": {
|
| 3 |
+
"ad hominem": 0.6914,
|
| 4 |
+
"appeal to authority": 0.7285,
|
| 5 |
+
"appeal to emotion": 0.6667,
|
| 6 |
+
"appeal to majority": 0.7826,
|
| 7 |
+
"appeal to nature": 0.8966,
|
| 8 |
+
"appeal to tradition": 0.8099,
|
| 9 |
+
"appeal to worse problems": 0.7833,
|
| 10 |
+
"circular reasoning": 0.5714,
|
| 11 |
+
"false causality": 0.6316,
|
| 12 |
+
"false dilemma": 0.8095,
|
| 13 |
+
"hasty generalization": 0.6043,
|
| 14 |
+
"none": 0.7583,
|
| 15 |
+
"red herring": 0.4211,
|
| 16 |
+
"slippery slope": 0.7712,
|
| 17 |
+
"straw man": 0.7368
|
| 18 |
+
},
|
| 19 |
+
"discord": {
|
| 20 |
+
"ad hominem": 0.6316,
|
| 21 |
+
"appeal to authority": 0.9756,
|
| 22 |
+
"appeal to emotion": 0.84,
|
| 23 |
+
"appeal to majority": 0.8571,
|
| 24 |
+
"appeal to nature": 0.8889,
|
| 25 |
+
"appeal to tradition": 0.8462,
|
| 26 |
+
"appeal to worse problems": 0.72,
|
| 27 |
+
"circular reasoning": 0.9091,
|
| 28 |
+
"false causality": 0.8205,
|
| 29 |
+
"false dilemma": 0.9,
|
| 30 |
+
"hasty generalization": 0.9091,
|
| 31 |
+
"none": 0.9037,
|
| 32 |
+
"red herring": 0.809,
|
| 33 |
+
"slippery slope": 0.88,
|
| 34 |
+
"straw man": 0.9474
|
| 35 |
+
}
|
| 36 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"cls_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 512,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 15 |
+
"trim_offsets": true,
|
| 16 |
+
"unk_token": "<unk>"
|
| 17 |
+
}
|