SamanthaStorm commited on
Commit
447c094
·
verified ·
1 Parent(s): 9b413e7

Upload FallacyFinder v1.0 - Advanced Logical Fallacy Detection Model

Browse files
README.md CHANGED
@@ -1,58 +1,76 @@
1
  ---
2
  language: en
3
- license: apache-2.0
4
- library_name: transformers
5
  tags:
6
- - boundary-detection
7
- - mental-health
8
- - communication
9
  - text-classification
10
- - psychology
 
 
 
 
11
  datasets:
12
  - custom
13
  metrics:
14
- - accuracy
15
- - f1
16
  model-index:
17
- - name: fallacyfinder
18
  results:
19
  - task:
20
  type: text-classification
21
- name: Boundary Health Classification
 
 
 
22
  metrics:
23
  - type: accuracy
24
  value: 1.0
25
- name: Accuracy
26
  - type: f1
27
  value: 1.0
28
- name: F1 Score
 
 
 
 
 
 
 
 
29
  ---
30
 
31
- # Healthy Boundary Predictor 🛡️
32
-
33
- A fine-tuned DistilBERT model for detecting healthy vs unhealthy boundaries in text communication.
34
 
35
  ## Model Description
36
 
37
- This model analyzes text to determine whether communication patterns reflect healthy or unhealthy boundaries. It's designed to help identify:
38
-
39
- - **Healthy Boundaries**: Clear communication, mutual respect, appropriate assertiveness
40
- - **Unhealthy Boundaries**: Manipulation, coercion, dismissiveness, control
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  ## Performance
43
 
44
- - **Accuracy**: 100%
45
- - **F1 Score**: 1.0
46
- - **Training Data**: 170+ carefully curated examples
47
- - **Architecture**: Fine-tuned DistilBERT
48
-
49
- ## Intended Use
50
-
51
- This model is designed for:
52
- - Mental health and communication tools
53
- - Educational applications about healthy relationships
54
- - Content moderation for communication platforms
55
- - Personal development and self-awareness tools
56
 
57
  ## Usage
58
 
@@ -61,59 +79,74 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
61
  import torch
62
 
63
  # Load model and tokenizer
64
- tokenizer = AutoTokenizer.from_pretrained("SamanthaStorm/fallacyfinder")
65
- model = AutoModelForSequenceClassification.from_pretrained("SamanthaStorm/fallacyfinder")
66
-
67
- # Example prediction
68
- text = "I need some time to think about this decision."
69
- inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
70
-
71
- with torch.no_grad():
72
- outputs = model(**inputs)
73
- predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
74
-
75
- healthy_prob = predictions[0][1].item()
76
- prediction = "healthy" if healthy_prob > 0.5 else "unhealthy"
77
-
78
- print(f"Prediction: {prediction} (confidence: {healthy_prob:.3f})")
 
 
 
 
 
 
 
79
  ```
80
 
81
  ## Training Data
82
 
83
- The model was trained on a diverse dataset including:
84
- - Professional workplace scenarios
85
- - Personal relationship communications
86
- - Family dynamics
87
- - Financial boundary situations
88
- - Emotional boundary examples
89
- - Nuanced examples with subtle manipulation patterns
90
 
91
- ## Limitations
92
 
93
- - This model is for educational and supportive purposes only
94
- - Not a substitute for professional mental health advice
95
- - Performance may vary on domains not seen during training
96
- - Cultural and contextual nuances may affect accuracy
 
 
97
 
98
- ## Ethical Considerations
99
 
100
- - Designed to promote healthy communication patterns
101
- - Should be used to support, not replace, human judgment
102
- - Privacy and consent important when analyzing personal communications
 
103
 
104
  ## Citation
105
 
106
- If you use this model, please cite:
107
 
108
  ```bibtex
109
- @misc{healthy-boundary-predictor,
110
- title={Healthy Boundary Predictor},
111
- author={SamanthaStorm},
112
- year={2025},
113
- url={https://huggingface.co/SamanthaStorm/fallacyfinder}
 
114
  }
115
  ```
116
 
117
  ## License
118
 
119
- Apache 2.0
 
 
 
 
 
1
  ---
2
  language: en
3
+ license: mit
 
4
  tags:
 
 
 
5
  - text-classification
6
+ - fallacy-detection
7
+ - logical-fallacies
8
+ - argument-analysis
9
+ - nlp
10
+ - transformers
11
  datasets:
12
  - custom
13
  metrics:
14
+ - accuracy: 1.0
15
+ - f1: 1.0
16
  model-index:
17
+ - name: FallacyFinder
18
  results:
19
  - task:
20
  type: text-classification
21
+ name: Fallacy Detection
22
+ dataset:
23
+ type: custom
24
+ name: Balanced Fallacy Dataset
25
  metrics:
26
  - type: accuracy
27
  value: 1.0
 
28
  - type: f1
29
  value: 1.0
30
+ widget:
31
+ - text: "You're just a stupid liberal, so your opinion doesn't matter"
32
+ example_title: "Ad Hominem Example"
33
+ - text: "So you're saying we should let all criminals run free?"
34
+ example_title: "Strawman Example"
35
+ - text: "What about when you made the same mistake last year?"
36
+ example_title: "Whataboutism Example"
37
+ - text: "I understand your perspective, but here's why I disagree based on the evidence"
38
+ example_title: "No Fallacy Example"
39
  ---
40
 
41
+ # FallacyFinder: Advanced Logical Fallacy Detection Model
 
 
42
 
43
  ## Model Description
44
 
45
+ FallacyFinder is a state-of-the-art text classification model trained to detect 16 different types of logical fallacies in text. Built on DistilBERT architecture, this model achieves perfect accuracy in identifying argumentative fallacies and healthy logical discourse.
46
+
47
+ ## Supported Fallacy Types
48
+
49
+ The model can detect the following 16 categories:
50
+
51
+ 1. **Ad Hominem** - Personal attacks instead of addressing arguments
52
+ 2. **Strawman** - Misrepresenting someone's position to make it easier to attack
53
+ 3. **Whataboutism** - Deflecting criticism by pointing to other issues
54
+ 4. **Gaslighting** - Making someone question their own reality or memory
55
+ 5. **False Dichotomy** - Presenting only two options when more exist
56
+ 6. **Appeal to Emotion** - Using emotional manipulation instead of logical reasoning
57
+ 7. **DARVO** - Deny, Attack, and Reverse Victim and Offender
58
+ 8. **Moving Goalposts** - Changing the criteria for acceptance when challenged
59
+ 9. **Cherry Picking** - Selecting only evidence that supports your position
60
+ 10. **Appeal to Authority** - Inappropriate reliance on authority figures
61
+ 11. **Slippery Slope** - Claiming that one event will lead to extreme consequences
62
+ 12. **Motte and Bailey** - Defending a weak position by conflating it with a stronger one
63
+ 13. **Gish Gallop** - Overwhelming opponents with many weak arguments
64
+ 14. **Kafkatrapping** - Claiming that denial of guilt proves guilt
65
+ 15. **Sealioning** - Persistent bad-faith requests for evidence
66
+ 16. **No Fallacy** - Healthy, logical communication
67
 
68
  ## Performance
69
 
70
+ - **Accuracy**: 100% on test set
71
+ - **Average Confidence**: 98.2%
72
+ - **Minimum Confidence**: 77.1%
73
+ - **F1 Score**: 1.0 (macro average)
 
 
 
 
 
 
 
 
74
 
75
  ## Usage
76
 
 
79
  import torch
80
 
81
  # Load model and tokenizer
82
+ model_name = "SamanthaStorm/fallacyfinder"
83
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
84
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
85
+
86
+ # Function to predict fallacy
87
+ def predict_fallacy(text):
88
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
89
+
90
+ with torch.no_grad():
91
+ outputs = model(**inputs)
92
+ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
93
+ predicted_class_id = predictions.argmax().item()
94
+ confidence = predictions.max().item()
95
+
96
+ predicted_label = model.config.id2label[predicted_class_id]
97
+ return predicted_label, confidence
98
+
99
+ # Example usage
100
+ text = "You're just being emotional and can't think rationally"
101
+ fallacy_type, confidence = predict_fallacy(text)
102
+ print(f"Fallacy Type: {fallacy_type}")
103
+ print(f"Confidence: {confidence:.3f}")
104
  ```
105
 
106
  ## Training Data
107
 
108
+ The model was trained on a carefully curated dataset of 3,200 examples (200 per fallacy type) with high-quality, diverse examples covering:
109
+ - Personal relationships
110
+ - Political discourse
111
+ - Workplace communication
112
+ - Online discussions
113
+ - Academic debates
114
+ - Social media interactions
115
 
116
+ ## Model Architecture
117
 
118
+ - **Base Model**: DistilBERT (distilbert-base-uncased)
119
+ - **Task**: Multi-class text classification
120
+ - **Classes**: 16 fallacy types
121
+ - **Max Sequence Length**: 512 tokens
122
+ - **Training Epochs**: 3
123
+ - **Batch Size**: 16
124
 
125
+ ## Limitations and Considerations
126
 
127
+ - Trained primarily on English text
128
+ - Performance may vary on highly ambiguous or context-dependent cases
129
+ - Best suited for clear argumentative text
130
+ - May require fine-tuning for domain-specific applications
131
 
132
  ## Citation
133
 
134
+ If you use this model in your research, please cite:
135
 
136
  ```bibtex
137
+ @misc{fallacyfinder2024,
138
+ author = {SamanthaStorm},
139
+ title = {FallacyFinder: Advanced Logical Fallacy Detection Model},
140
+ year = {2024},
141
+ publisher = {Hugging Face},
142
+ url = {https://huggingface.co/SamanthaStorm/fallacyfinder}
143
  }
144
  ```
145
 
146
  ## License
147
 
148
+ This model is released under the MIT License.
149
+
150
+ ## Contact
151
+
152
+ For questions or issues, please open an issue on the model repository.
config.json CHANGED
@@ -4,17 +4,71 @@
4
  "DistilBertForSequenceClassification"
5
  ],
6
  "attention_dropout": 0.1,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  "dim": 768,
8
  "dropout": 0.1,
9
  "hidden_dim": 3072,
10
  "id2label": {
11
- "0": "unhealthy",
12
- "1": "healthy"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  },
14
  "initializer_range": 0.02,
15
  "label2id": {
16
- "unhealthy": 0,
17
- "healthy": 1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  },
19
  "max_position_embeddings": 512,
20
  "model_type": "distilbert",
@@ -25,8 +79,14 @@
25
  "qa_dropout": 0.1,
26
  "seq_classif_dropout": 0.2,
27
  "sinusoidal_pos_embds": false,
 
 
 
 
 
 
28
  "tie_weights_": true,
29
  "torch_dtype": "float32",
30
  "transformers_version": "4.53.0",
31
  "vocab_size": 30522
32
- }
 
4
  "DistilBertForSequenceClassification"
5
  ],
6
  "attention_dropout": 0.1,
7
+ "custom_metadata": {
8
+ "average_confidence": 0.982,
9
+ "creation_date": "2024",
10
+ "fallacy_types": [
11
+ "ad_hominem",
12
+ "appeal_to_authority",
13
+ "appeal_to_emotion",
14
+ "cherry_picking",
15
+ "darvo",
16
+ "false_dichotomy",
17
+ "gaslighting",
18
+ "gish_gallop",
19
+ "kafkatrapping",
20
+ "motte_and_bailey",
21
+ "moving_goalposts",
22
+ "no_fallacy",
23
+ "sealioning",
24
+ "slippery_slope",
25
+ "strawman",
26
+ "whataboutism"
27
+ ],
28
+ "model_version": "1.0.0",
29
+ "test_accuracy": 1.0,
30
+ "training_dataset_size": 3200,
31
+ "training_framework": "transformers"
32
+ },
33
  "dim": 768,
34
  "dropout": 0.1,
35
  "hidden_dim": 3072,
36
  "id2label": {
37
+ "0": "ad_hominem",
38
+ "1": "appeal_to_authority",
39
+ "2": "appeal_to_emotion",
40
+ "3": "cherry_picking",
41
+ "4": "darvo",
42
+ "5": "false_dichotomy",
43
+ "6": "gaslighting",
44
+ "7": "gish_gallop",
45
+ "8": "kafkatrapping",
46
+ "9": "motte_and_bailey",
47
+ "10": "moving_goalposts",
48
+ "11": "no_fallacy",
49
+ "12": "sealioning",
50
+ "13": "slippery_slope",
51
+ "14": "strawman",
52
+ "15": "whataboutism"
53
  },
54
  "initializer_range": 0.02,
55
  "label2id": {
56
+ "ad_hominem": 0,
57
+ "appeal_to_authority": 1,
58
+ "appeal_to_emotion": 2,
59
+ "cherry_picking": 3,
60
+ "darvo": 4,
61
+ "false_dichotomy": 5,
62
+ "gaslighting": 6,
63
+ "gish_gallop": 7,
64
+ "kafkatrapping": 8,
65
+ "motte_and_bailey": 9,
66
+ "moving_goalposts": 10,
67
+ "no_fallacy": 11,
68
+ "sealioning": 12,
69
+ "slippery_slope": 13,
70
+ "strawman": 14,
71
+ "whataboutism": 15
72
  },
73
  "max_position_embeddings": 512,
74
  "model_type": "distilbert",
 
79
  "qa_dropout": 0.1,
80
  "seq_classif_dropout": 0.2,
81
  "sinusoidal_pos_embds": false,
82
+ "task_specific_params": {
83
+ "text-classification": {
84
+ "num_labels": 16,
85
+ "problem_type": "single_label_classification"
86
+ }
87
+ },
88
  "tie_weights_": true,
89
  "torch_dtype": "float32",
90
  "transformers_version": "4.53.0",
91
  "vocab_size": 30522
92
+ }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ed99c70604a4f58426e3a0ee35843e0b0a35c6305d44eb86f7ae8bee2ad83350
3
  size 267875632
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d4a1ba0a82b1ce425006e306bc3d3d758343ce7d7d298ac3a5123aac449f6b9
3
  size 267875632
special_tokens_map.json CHANGED
@@ -1,7 +1,37 @@
1
  {
2
- "cls_token": "[CLS]",
3
- "mask_token": "[MASK]",
4
- "pad_token": "[PAD]",
5
- "sep_token": "[SEP]",
6
- "unk_token": "[UNK]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
 
1
  {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
  }
tokenizer.json CHANGED
@@ -1,7 +1,19 @@
1
  {
2
  "version": "1.0",
3
- "truncation": null,
4
- "padding": null,
 
 
 
 
 
 
 
 
 
 
 
 
5
  "added_tokens": [
6
  {
7
  "id": 0,
 
1
  {
2
  "version": "1.0",
3
+ "truncation": {
4
+ "direction": "Right",
5
+ "max_length": 512,
6
+ "strategy": "LongestFirst",
7
+ "stride": 0
8
+ },
9
+ "padding": {
10
+ "strategy": "BatchLongest",
11
+ "direction": "Right",
12
+ "pad_to_multiple_of": null,
13
+ "pad_id": 0,
14
+ "pad_type_id": 0,
15
+ "pad_token": "[PAD]"
16
+ },
17
  "added_tokens": [
18
  {
19
  "id": 0,
tokenizer_config.json CHANGED
@@ -46,11 +46,18 @@
46
  "do_lower_case": true,
47
  "extra_special_tokens": {},
48
  "mask_token": "[MASK]",
 
49
  "model_max_length": 512,
 
50
  "pad_token": "[PAD]",
 
 
51
  "sep_token": "[SEP]",
 
52
  "strip_accents": null,
53
  "tokenize_chinese_chars": true,
54
  "tokenizer_class": "DistilBertTokenizer",
 
 
55
  "unk_token": "[UNK]"
56
  }
 
46
  "do_lower_case": true,
47
  "extra_special_tokens": {},
48
  "mask_token": "[MASK]",
49
+ "max_length": 512,
50
  "model_max_length": 512,
51
+ "pad_to_multiple_of": null,
52
  "pad_token": "[PAD]",
53
+ "pad_token_type_id": 0,
54
+ "padding_side": "right",
55
  "sep_token": "[SEP]",
56
+ "stride": 0,
57
  "strip_accents": null,
58
  "tokenize_chinese_chars": true,
59
  "tokenizer_class": "DistilBertTokenizer",
60
+ "truncation_side": "right",
61
+ "truncation_strategy": "longest_first",
62
  "unk_token": "[UNK]"
63
  }
training_info.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_name": "FallacyFinder",
3
+ "base_model": "distilbert-base-uncased",
4
+ "training_examples": 2240,
5
+ "validation_examples": 480,
6
+ "test_examples": 480,
7
+ "total_examples": 3200,
8
+ "classes": 16,
9
+ "accuracy": 1.0,
10
+ "f1_score": 1.0,
11
+ "training_epochs": 3,
12
+ "batch_size": 16,
13
+ "max_length": 512
14
+ }