Text Generation
Transformers
Safetensors
English
bart
text2text-generation
style-transfer
rewriting
humanization
seq2seq
evaluation
bertscore
rouge
chrf
Instructions to use cive202/humanize-ai-text-bart-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cive202/humanize-ai-text-bart-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cive202/humanize-ai-text-bart-base")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("cive202/humanize-ai-text-bart-base") model = AutoModelForSeq2SeqLM.from_pretrained("cive202/humanize-ai-text-bart-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cive202/humanize-ai-text-bart-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cive202/humanize-ai-text-bart-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cive202/humanize-ai-text-bart-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cive202/humanize-ai-text-bart-base
- SGLang
How to use cive202/humanize-ai-text-bart-base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "cive202/humanize-ai-text-bart-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cive202/humanize-ai-text-bart-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "cive202/humanize-ai-text-bart-base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cive202/humanize-ai-text-bart-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cive202/humanize-ai-text-bart-base with Docker Model Runner:
docker model run hf.co/cive202/humanize-ai-text-bart-base
Create README.md
Browse files
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`.
|