cive202 commited on
Commit
5fd97b0
·
verified ·
1 Parent(s): de3ef15

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +134 -0
README.md ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: mit
5
+ tags:
6
+ - text-generation
7
+ - style-transfer
8
+ - rewriting
9
+ - humanization
10
+ - seq2seq
11
+ - bart
12
+ - evaluation
13
+ - bertscore
14
+ - rouge
15
+ - chrf
16
+ library_name: transformers
17
+ base_model: facebook/bart-base
18
+ pipeline_tag: text-generation
19
+ ---
20
+
21
+ # cive202/humanize-ai-text-bart-base
22
+
23
+ Fine-tuned **BART-base** (`facebook/bart-base`) for **AI → Human rewriting** (“humanization”) via prefix-based conditional generation.
24
+
25
+ - **Architecture**: encoder–decoder (seq2seq)
26
+ - **Parameters**: ~139M
27
+ - **Task format**: `humanize: {ai_text}` → `{human_text}`
28
+
29
+ ---
30
+
31
+ ## Quickstart
32
+
33
+ ```bash
34
+ pip install -U "transformers>=4.40.0" torch sentencepiece
35
+ ```
36
+
37
+ ```python
38
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
39
+
40
+ model_id = "cive202/humanize-ai-text-bart-base"
41
+
42
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
43
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
44
+
45
+ ai_text = "Large language models often produce fluent, structured prose with recognizable regularities..."
46
+
47
+ inputs = tokenizer("humanize: " + ai_text, return_tensors="pt", truncation=True)
48
+
49
+ out = model.generate(
50
+ **inputs,
51
+ max_new_tokens=256,
52
+ num_beams=4,
53
+ )
54
+
55
+ print(tokenizer.decode(out[0], skip_special_tokens=True))
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Training note (important)
61
+
62
+ This checkpoint corresponds to a **smoke-test / pipeline validation run**, not a full training run.
63
+
64
+ Saved config characteristics:
65
+
66
+ - `max_steps = 10`
67
+ - `max_train_samples = 128`
68
+ - `num_train_epochs = 1`
69
+
70
+ ⚠️ Interpret results below as a **lower-bound baseline**, not a fully optimized model.
71
+
72
+ ---
73
+
74
+ ## Dataset
75
+
76
+ Parallel chunk pairs created via sentence-aware chunking:
77
+
78
+ - **Train**: 25,140 pairs
79
+ - **Validation**: 1,390
80
+ - **Test**: 1,390
81
+
82
+ ### Preprocessing
83
+
84
+ - Sentence tokenization (NLTK)
85
+ - Greedy token packing (≤200 tokens)
86
+ - Filtering short pairs (<10 words)
87
+ - Document-disjoint splits
88
+
89
+ ---
90
+
91
+ ## Evaluation (test n = 1,390)
92
+
93
+ ### Reference similarity
94
+
95
+ - **BERTScore F1**: **0.9088**
96
+ - **ROUGE-L**: **0.4448**
97
+ - **chrF++**: **46.4131**
98
+
99
+ ### Fluency proxy
100
+
101
+ - **GPT-2 PPL (output)**: **26.6919**
102
+ - **GPT-2 PPL (human)**: **23.6912**
103
+
104
+ ### Style shift
105
+
106
+ - **Mean marker shift**: **0.6513**
107
+
108
+ This baseline partially shifts text toward human-like distributions but is limited by minimal training.
109
+
110
+ ---
111
+
112
+ ## Limitations
113
+
114
+ - Not a fully trained model (smoke-test configuration)
115
+ - Limited style transformation strength
116
+ - No guarantee of bypassing AI detectors
117
+ - Lower performance compared to larger/full runs
118
+
119
+ ---
120
+
121
+ ## Research context
122
+
123
+ Part of the unpublished 2026 manuscript:
124
+
125
+ **“Rewriting the Machine: Encoder-Decoder vs. Decoder-Only Transformers for AI-to-Human Text Style Transfer”**
126
+
127
+ - Status: Not published
128
+ - Link: [ADD WHEN AVAILABLE]
129
+
130
+ ---
131
+
132
+ ## License
133
+
134
+ MIT (placeholder). Ensure compatibility with `facebook/bart-base`.