Loule commited on
Commit
fe19ac3
·
verified ·
1 Parent(s): b561dd3

Auto-improve cycle 8 — F1=95.7%

Browse files
README.md CHANGED
@@ -43,19 +43,9 @@ model-index:
43
  - name: F1 Micro
44
  type: f1
45
  value: 0.970
46
- verified: false
47
  - name: F1 Macro
48
  type: f1
49
- value: 0.966
50
- verified: false
51
- - name: Precision
52
- type: precision
53
- value: 0.953
54
- verified: false
55
- - name: Recall
56
- type: recall
57
- value: 0.989
58
- verified: false
59
  ---
60
 
61
  # Egide Toxicity Model
@@ -64,7 +54,7 @@ Modele de detection de toxicite multilingue (francais/anglais) concu pour la mod
64
 
65
  ## Description
66
 
67
- Ce modele a ete fine-tune a partir de `xlm-roberta-base` pour la classification multi-label de contenu toxique. Il a ete concu specifiquement pour le projet [Egide](https://github.com/Loule95450/Egide), un bot de moderation Twitch alimente par l'IA.
68
 
69
  Le modele detecte **6 categories de toxicite** sans aucune regle codee en dur : tout repose sur l'inference IA.
70
 
@@ -81,51 +71,26 @@ Le modele detecte **6 categories de toxicite** sans aucune regle codee en dur :
81
 
82
  ## Performance
83
 
84
- ### Evaluation sur le jeu de test (2204 exemples, 15% du dataset)
85
-
86
- | Metrique | Score |
87
- |---|---|
88
- | **F1 Micro** | **97.0%** |
89
- | **F1 Macro** | **96.6%** |
90
- | **Precision** | **95.3%** |
91
- | **Recall** | **98.9%** |
92
-
93
- ### F1 par categorie
94
 
95
  | Categorie | F1 Score |
96
  |---|---|
97
- | toxicity | 98.2% |
98
- | insult | 97.3% |
99
- | hate | 95.4% |
100
- | sexual | 100% |
101
- | threat | 94.4% |
102
- | identity_attack | 94.2% |
103
-
104
- ### Benchmark sur 1000 messages (conditions reelles)
105
-
106
- Teste avec un benchmark de 1000 messages simulant un chat Twitch reel (messages propres, insultes, haine, sexisme, menaces, doxxing, homophobie, evasion leet-speak, pieges a faux positifs) :
107
-
108
- | Metrique | Score |
109
- |---|---|
110
- | **Accuracy** | **95.8%** |
111
- | **Precision** | **95.9%** |
112
- | **Recall** | **96.3%** |
113
- | **F1 Score** | **96.1%** |
114
- | True Positives | 520 |
115
- | True Negatives | 438 |
116
- | False Positives | 22 |
117
- | False Negatives | 20 |
118
-
119
- **Categories a 100% de precision** : greetings, compliments, questions, reactions, casual, doxxing, hate, homophobie, menaces, toxicite subtile, pieges a faux positifs.
120
 
121
  ## Points forts
122
 
123
  - **Multilingue** : Comprend le francais et l'anglais nativement
124
  - **Texte obfusque** : Detecte les insultes deguisees comme "ntm", "n t m", "fdp", "f.d.p", "c0nn4rd", "k y s", etc.
125
  - **Contexte gaming** : Ne flag PAS les expressions figuratives courantes en gaming ("ca tue ce jeu", "je suis mort de rire", "this game is killing me")
126
- - **Argot Twitch** : Entraine sur du vrai vocabulaire de chat Twitch (emotes, abreviations, slang) collecte sur 56 chaines live
127
  - **Zero faux pattern** : Aucune regex, aucune liste de mots interdits, 100% IA
128
- - **Perte ponderee** : Utilise BCEWithLogitsLoss avec pos_weight pour gerer le desequilibre de classes
129
 
130
  ## Utilisation
131
 
@@ -177,40 +142,20 @@ curl -X POST http://localhost:8000/analyze \
177
 
178
  ## Entrainement
179
 
180
- - **Modele de base** : `xlm-roberta-base` (278M parametres)
181
  - **Type** : Multi-label classification
182
- - **Loss** : BCEWithLogitsLoss avec pos_weight (perte ponderee pour classes desequilibrees)
183
- - **Meilleur modele** : Epoch 11 (selectionne par F1 Macro)
184
- - **Epochs** : 12
185
  - **Batch size** : 8
186
  - **Learning rate** : 2e-5
187
  - **Warmup** : 10%
188
- - **Weight decay** : 0.01
189
- - **Dataset** : 4897 exemples curates x3 augmentation = 14 691 exemples
190
- - **612 exemples toxiques (12.5%)** :
191
- - Insultes francaises (standard + obfusquees + manquees)
192
- - Discours de haine (racisme, xenophobie, antisemitisme)
193
- - Sexisme
194
- - Homophobie / transphobie
195
- - Menaces (standard + obfusquees)
196
- - Insultes anglaises (standard + obfusquees)
197
- - Doxxing / partage d'infos personnelles
198
- - Toxicite subtile / passive-aggressive
199
- - **4285 exemples non-toxiques (87.5%)** :
200
- - 3638 messages reels de chat Twitch collectes sur 56 chaines live (faux positifs confirmes + messages propres)
201
- - 382 exemples classiques non-toxiques
202
- - 265 exemples d'argot Twitch (emotes, abreviations, greetings, slang)
203
-
204
- ### Poids positifs par label (gestion du desequilibre)
205
-
206
- | Label | Poids | Positifs | Negatifs |
207
- |---|---|---|---|
208
- | toxicity | 6.98 | 1565 | 10922 |
209
- | insult | 10.00 | 876 | 11611 |
210
- | hate | 10.00 | 456 | 12031 |
211
- | sexual | 10.00 | 95 | 12392 |
212
- | threat | 10.00 | 192 | 12295 |
213
- | identity_attack | 10.00 | 332 | 12155 |
214
 
215
  ## Architecture du projet Egide
216
 
@@ -222,9 +167,9 @@ Le bot Node.js envoie les messages au service Python via HTTP. Le service charge
222
 
223
  ## Limitations
224
 
225
- - Entraine principalement sur du francais et de l'anglais. D'autres langues peuvent fonctionner grace a XLM-RoBERTa mais avec moins de precision.
226
- - Certaines formes d'evasion (leet speak, espacement) peuvent encore echapper a la detection ("enf0ire", "nique sa mere" sans accent).
227
- - Les critiques subtiles mais non-toxiques peuvent parfois etre faussement flaggees ("Le jeu est nul pas toi", "Y'a de meilleurs streamers").
228
 
229
  ## Licence
230
 
@@ -236,7 +181,7 @@ Apache 2.0
236
  @misc{egide-toxicity-model,
237
  author = {Loule},
238
  title = {Egide Toxicity Model - Multilingual Toxicity Detection for Twitch Chat},
239
- year = {2026},
240
  publisher = {HuggingFace},
241
  url = {https://huggingface.co/Loule/egide-toxicity-model}
242
  }
 
43
  - name: F1 Micro
44
  type: f1
45
  value: 0.970
 
46
  - name: F1 Macro
47
  type: f1
48
+ value: 0.969
 
 
 
 
 
 
 
 
 
49
  ---
50
 
51
  # Egide Toxicity Model
 
54
 
55
  ## Description
56
 
57
+ Ce modele a ete entraine pour la classification multi-label de contenu toxique. Il a ete concu specifiquement pour le projet [Egide](https://github.com/Loule95450/Egide), un bot de moderation Twitch alimente par l'IA.
58
 
59
  Le modele detecte **6 categories de toxicite** sans aucune regle codee en dur : tout repose sur l'inference IA.
60
 
 
71
 
72
  ## Performance
73
 
74
+ Evalue sur un jeu de test de 243 exemples (15% du dataset) :
 
 
 
 
 
 
 
 
 
75
 
76
  | Categorie | F1 Score |
77
  |---|---|
78
+ | **toxicity** | 0.981 |
79
+ | **insult** | 0.974 |
80
+ | **hate** | 0.949 |
81
+ | **sexual** | 1.000 |
82
+ | **threat** | 0.966 |
83
+ | **identity_attack** | 0.945 |
84
+ | **F1 Micro** | **0.970** |
85
+ | **F1 Macro** | **0.969** |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
 
87
  ## Points forts
88
 
89
  - **Multilingue** : Comprend le francais et l'anglais nativement
90
  - **Texte obfusque** : Detecte les insultes deguisees comme "ntm", "n t m", "fdp", "f.d.p", "c0nn4rd", "k y s", etc.
91
  - **Contexte gaming** : Ne flag PAS les expressions figuratives courantes en gaming ("ca tue ce jeu", "je suis mort de rire", "this game is killing me")
92
+ - **Argot Twitch** : Entraine sur du vocabulaire de chat Twitch (emotes, abreviations, slang)
93
  - **Zero faux pattern** : Aucune regex, aucune liste de mots interdits, 100% IA
 
94
 
95
  ## Utilisation
96
 
 
142
 
143
  ## Entrainement
144
 
 
145
  - **Type** : Multi-label classification
146
+ - **Loss** : BCEWithLogitsLoss
147
+ - **Epochs** : 10 (best model a l'epoch 7)
 
148
  - **Batch size** : 8
149
  - **Learning rate** : 2e-5
150
  - **Warmup** : 10%
151
+ - **Dataset** : 539 exemples curates x3 augmentation = 1617 exemples
152
+ - Insultes francaises (standard + obfusquees)
153
+ - Discours de haine (racisme, xenophobie, antisemitisme)
154
+ - Sexisme
155
+ - Homophobie / transphobie
156
+ - Menaces (standard + obfusquees)
157
+ - Insultes anglaises (standard + obfusquees)
158
+ - ~150 exemples non-toxiques (chat Twitch, expressions figuratives, emotes)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
 
160
  ## Architecture du projet Egide
161
 
 
167
 
168
  ## Limitations
169
 
170
+ - Entraine principalement sur du francais et de l'anglais. D'autres langues peuvent fonctionner mais avec moins de precision.
171
+ - Le dataset d'entrainement est relativement petit (539 exemples uniques). Des ameliorations sont possibles en ajoutant plus de donnees.
172
+ - Les nouvelles formes d'obfuscation non vues a l'entrainement peuvent echapper a la detection.
173
 
174
  ## Licence
175
 
 
181
  @misc{egide-toxicity-model,
182
  author = {Loule},
183
  title = {Egide Toxicity Model - Multilingual Toxicity Detection for Twitch Chat},
184
+ year = {2025},
185
  publisher = {HuggingFace},
186
  url = {https://huggingface.co/Loule/egide-toxicity-model}
187
  }
checkpoint-10116/config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "XLMRobertaForSequenceClassification"
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": "LABEL_0",
16
+ "1": "LABEL_1",
17
+ "2": "LABEL_2",
18
+ "3": "LABEL_3",
19
+ "4": "LABEL_4",
20
+ "5": "LABEL_5"
21
+ },
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 3072,
24
+ "is_decoder": false,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1,
28
+ "LABEL_2": 2,
29
+ "LABEL_3": 3,
30
+ "LABEL_4": 4,
31
+ "LABEL_5": 5
32
+ },
33
+ "layer_norm_eps": 1e-05,
34
+ "max_position_embeddings": 514,
35
+ "model_type": "xlm-roberta",
36
+ "num_attention_heads": 12,
37
+ "num_hidden_layers": 12,
38
+ "output_past": true,
39
+ "pad_token_id": 1,
40
+ "position_embedding_type": "absolute",
41
+ "problem_type": "multi_label_classification",
42
+ "tie_word_embeddings": true,
43
+ "transformers_version": "5.2.0",
44
+ "type_vocab_size": 1,
45
+ "use_cache": false,
46
+ "vocab_size": 250002
47
+ }
checkpoint-10116/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce07fe7999dc347dff7dbefe7220f22e45dd7bbfd84f014df51343f9841025a3
3
+ size 1112217288
checkpoint-10116/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8860905400159773bd8e306232ce3d7286bec2fef74c2e47659b4362133745f5
3
+ size 2224549003
checkpoint-10116/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e38e4bded6fa666a78b369223010c84f8eafdd4ce4069224aa6f2854b4222440
3
+ size 14455
checkpoint-10116/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d387f002bc7eb25457dd64c63b2422eb747ab631ed7ebc80279b42718ab00662
3
+ size 1465
checkpoint-10116/trainer_state.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-10116/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebdc3d07a5dca3e7b0152072589f926cb3878579b56582b670d1880fb774230e
3
+ size 5265
checkpoint-8430/config.json ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "XLMRobertaForSequenceClassification"
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": "LABEL_0",
16
+ "1": "LABEL_1",
17
+ "2": "LABEL_2",
18
+ "3": "LABEL_3",
19
+ "4": "LABEL_4",
20
+ "5": "LABEL_5"
21
+ },
22
+ "initializer_range": 0.02,
23
+ "intermediate_size": 3072,
24
+ "is_decoder": false,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1,
28
+ "LABEL_2": 2,
29
+ "LABEL_3": 3,
30
+ "LABEL_4": 4,
31
+ "LABEL_5": 5
32
+ },
33
+ "layer_norm_eps": 1e-05,
34
+ "max_position_embeddings": 514,
35
+ "model_type": "xlm-roberta",
36
+ "num_attention_heads": 12,
37
+ "num_hidden_layers": 12,
38
+ "output_past": true,
39
+ "pad_token_id": 1,
40
+ "position_embedding_type": "absolute",
41
+ "problem_type": "multi_label_classification",
42
+ "tie_word_embeddings": true,
43
+ "transformers_version": "5.2.0",
44
+ "type_vocab_size": 1,
45
+ "use_cache": false,
46
+ "vocab_size": 250002
47
+ }
checkpoint-8430/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:567f20e8a633069d2f3739140dbd92d459f54141439aa81ec0dccb37cbd0169e
3
+ size 1112217288
checkpoint-8430/optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d3fd5fe2d90bdd7ef2971bdc1ede0e8d98017088bd7b3e70ab8c556554108a1
3
+ size 2224549003
checkpoint-8430/rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b652c6269b998b96ab924b2734c0818fab436c642524e13fc6cd4d9082e62b5
3
+ size 14455
checkpoint-8430/scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d983e9e82ac87acb66331cc9b5cfaa6ff89e902db822c7a81f3220ba99096811
3
+ size 1465
checkpoint-8430/trainer_state.json ADDED
The diff for this file is too large to render. See raw diff
 
checkpoint-8430/training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ebdc3d07a5dca3e7b0152072589f926cb3878579b56582b670d1880fb774230e
3
+ size 5265
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:93ccc157babf759538671d0a161d828d59dcdca75b4d872da486ba037e178495
3
  size 1112217288
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ce07fe7999dc347dff7dbefe7220f22e45dd7bbfd84f014df51343f9841025a3
3
  size 1112217288