anulum commited on
Commit
3d82579
·
verified ·
1 Parent(s): 91bc52d

Upload fine-tuned DeBERTa-v3-large hallucination model

Browse files
README.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: agpl-3.0
3
+ language: en
4
+ tags:
5
+ - hallucination-detection
6
+ - nli
7
+ - deberta-v3
8
+ - director-ai
9
+ datasets:
10
+ - pminervini/HaluEval
11
+ - pietrolesci/nli_fever
12
+ - tals/vitaminc
13
+ - anli
14
+ base_model: MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli
15
+ pipeline_tag: text-classification
16
+ ---
17
+
18
+ # DeBERTa-v3-large -- Hallucination Detection
19
+
20
+ Fine-tuned for hallucination detection as part of
21
+ [Director-AI](https://github.com/anulum/director-ai).
22
+
23
+ ## Training
24
+
25
+ - **Base**: MoritzLaurer/DeBERTa-v3-large-mnli-fever-anli-ling-wanli
26
+ - **Data**: ~100K examples from HaluEval, FEVER, VitaminC, ANLI R3
27
+ - **Epochs**: 3, lr 2e-5, batch 32 (effective), class-weighted CE loss
28
+ - **Labels**: 0 = entailment, 1 = neutral, 2 = contradiction
29
+
30
+ ## Usage
31
+
32
+ ```python
33
+ from director_ai.core import NLIScorer
34
+
35
+ scorer = NLIScorer(model_name="anulum/deberta-v3-large-hallucination")
36
+ score = scorer.score("The capital of France is Paris.", "Paris is in Germany.")
37
+ ```
38
+
39
+ ## License
40
+
41
+ AGPL-3.0 | Commercial licensing: [anulum.li](https://www.anulum.li)
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DebertaV2ForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "hidden_act": "gelu",
7
+ "hidden_dropout_prob": 0.1,
8
+ "hidden_size": 1024,
9
+ "id2label": {
10
+ "0": "entailment",
11
+ "1": "neutral",
12
+ "2": "contradiction"
13
+ },
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 4096,
16
+ "label2id": {
17
+ "contradiction": 2,
18
+ "entailment": 0,
19
+ "neutral": 1
20
+ },
21
+ "layer_norm_eps": 1e-07,
22
+ "legacy": true,
23
+ "max_position_embeddings": 512,
24
+ "max_relative_positions": -1,
25
+ "model_type": "deberta-v2",
26
+ "norm_rel_ebd": "layer_norm",
27
+ "num_attention_heads": 16,
28
+ "num_hidden_layers": 24,
29
+ "pad_token_id": 0,
30
+ "pooler_dropout": 0,
31
+ "pooler_hidden_act": "gelu",
32
+ "pooler_hidden_size": 1024,
33
+ "pos_att_type": [
34
+ "p2c",
35
+ "c2p"
36
+ ],
37
+ "position_biased_input": false,
38
+ "position_buckets": 256,
39
+ "relative_attention": true,
40
+ "share_att_key": true,
41
+ "torch_dtype": "float32",
42
+ "transformers_version": "4.51.3",
43
+ "type_vocab_size": 0,
44
+ "vocab_size": 128100
45
+ }
final_metrics.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "eval_loss": 0.3152,
3
+ "eval_accuracy": 0.9106,
4
+ "eval_f1": 0.8897,
5
+ "eval_f1_entailment": 0.948,
6
+ "eval_f1_neutral": 0.8246,
7
+ "eval_f1_contradiction": 0.8965,
8
+ "eval_runtime": 732.7963,
9
+ "eval_samples_per_second": 100.201,
10
+ "eval_steps_per_second": 3.132,
11
+ "epoch": 0.1937
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:75c6cf7d9945143581b8c517d1d44f5717d6fed156b354fcd995b6eb89570163
3
+ size 1740308548
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": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": false,
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
+ "max_length": 512,
52
+ "model_max_length": 512,
53
+ "pad_token": "[PAD]",
54
+ "sep_token": "[SEP]",
55
+ "sp_model_kwargs": {},
56
+ "split_by_punct": false,
57
+ "stride": 0,
58
+ "tokenizer_class": "DebertaV2Tokenizer",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "[UNK]",
62
+ "vocab_type": "spm"
63
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a511b7432da657c4e6744c1684e63afca070c0b26d8251a06b7afe188dcc464
3
+ size 5777