boying07 commited on
Commit
b0bf783
Β·
verified Β·
1 Parent(s): e4e5238

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +65 -3
README.md CHANGED
@@ -187,13 +187,75 @@ This repository contains:
187
  ---
188
 
189
  # Usage
190
-
191
  Example:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
 
193
- ```python
194
- python inference2.py
 
 
 
 
 
 
 
195
  ```
196
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  Inference modes:
198
 
199
  * OR
 
187
  ---
188
 
189
  # Usage
 
190
  Example:
191
+ ## Folder Structure
192
+
193
+ ```text
194
+ HomayShield/
195
+ β”‚
196
+ β”œβ”€β”€ datasets/
197
+ β”‚ β”œβ”€β”€ token_level_adversarial_tr_v2.jsonl
198
+ β”‚ β”œβ”€β”€ token_level_adversarial_en_v2.jsonl
199
+ β”‚ └── final_classifier_merged_all.jsonl
200
+ β”‚
201
+ β”œβ”€β”€ output/
202
+ β”‚ └── Homayv6/
203
+ β”‚ β”œβ”€β”€ homayshield_encoder.pt
204
+ β”‚ β”œβ”€β”€ homayshield_classifier.pt
205
+ β”‚ └── homayshield_attack_bank.npy
206
+ β”‚
207
+ β”œβ”€β”€ training2.py
208
+ β”œβ”€β”€ inference.py
209
+ └── requirements.txt
210
+ ```
211
+
212
+ ---
213
 
214
+ ## Training Command
215
+
216
+ ```bash
217
+ python training2.py \
218
+ --train \
219
+ ./datasets/token_level_adversarial_tr_v2.jsonl \
220
+ ./datasets/token_level_adversarial_en_v2.jsonl \
221
+ ./datasets/final_classifier_merged_all.jsonl \
222
+ --output-dir ./output/Homayv6
223
  ```
224
 
225
+ ---
226
+
227
+ ## Output Files After Training
228
+
229
+ Training generates:
230
+
231
+ ```text
232
+ output/Homayv6/
233
+ β”œβ”€β”€ homayshield_encoder.pt
234
+ β”œβ”€β”€ homayshield_classifier.pt
235
+ └── homayshield_attack_bank.npy
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Inference Command
241
+
242
+ ```bash
243
+ python inference.py
244
+ ```
245
+
246
+ Inference loads:
247
+
248
+ * `homayshield_encoder.pt`
249
+ * `homayshield_classifier.pt`
250
+ * `homayshield_attack_bank.npy`
251
+
252
+ from:
253
+
254
+ ```text
255
+ ./output/Homayv6/
256
+ ```
257
+
258
+
259
  Inference modes:
260
 
261
  * OR