Downloads · 30 days
139
22% of all-time downloads
thealper2/flan-t5-base-text-paraphraser
flan-t5-base-text-paraphraser is a text generation model from thealper2. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
Text paraphraser: google/flan-t5-base fine-tuned (full fine-tuning, standard seq2seq cross-entropy) on the paranmt5m configuration of redis/langcache-sentencepairs-v3 (ParaNMT-5M sentence pairs). No other data was use…
Downloads · 30 days
139
22% of all-time downloads
All-time downloads
626
Public
Parameters
248M
990 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
Text paraphraser: google/flan-t5-base fine-tuned (full fine-tuning, standard seq2seq cross-entropy) on the
paranmt5m configuration of redis/langcache-sentencepairs-v3 (ParaNMT-5M sentence pairs). No other data was used. Training used a seeded random subset of 1,000,000 pairs out of 5,041,448 usable training pairs.
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_id = "thealper2/flan-t5-base-text-paraphraser"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
text = "paraphrase: the weather was extremely cold yesterday ."
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, num_beams=8, num_return_sequences=3, max_new_tokens=128)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
Input format: paraphrase: <sentence> (prefix is required; also stored in paraphraser_config.json).
Default generation config: beam search, num_beams=4, max_new_tokens=128.
redis/langcache-sentencepairs-v3, config paranmt5m (single train split, all label=1).sentence1 → sentence2. `` / '') mapped to "
(the T5 vocabulary has no backtick), control-character / U+FFFD / no-letter filtering, removal of pairs identical
after normalization or differing only in case/punctuation, exact pair deduplication, word-length-ratio filter
(>3.0 when the longer side has ≥10 words),
token-length filter (128 source incl. prefix / 128 target). No truncation.| Stage | Pairs |
|---|---|
Raw paranmt5m train split | 5,370,126 |
| − non_positive_label | 0 |
| − null_values | 0 |
| − non_string_values | 0 |
| − empty_strings | 0 |
| − malformed_replacement_character | 127 |
| − malformed_control_characters | 3,012 |
| − malformed_no_letters | 399 |
| − source_equals_target_after_normalization | 876 |
| − trivial_variant_case_or_punctuation_only | 68,851 |
| − exact_duplicate_pairs | 157,615 |
| − exceeds_token_limits_128_128 | 319 |
| − word_length_ratio_above_3.0 | 17,356 |
| − test pairs overlapping validation (dropped) | 18 |
| Usable pairs | 5,121,553 |
| Split | Pairs | Share |
|---|---|---|
| train | 5,041,448 | 98.44% |
| validation | 39,837 | 0.78% |
| test | 40,268 | 0.79% |
| Setting | Value |
|---|---|
| Base model | google/flan-t5-base (247,577,856 parameters) |
| Training examples | 1,000,000 |
| Epochs | 2.00 |
| Optimizer steps | 62,500 |
| Per-device batch × grad. accumulation | 32 × 1 |
| Effective batch size | 32 |
| Learning rate / schedule | 3e-05 / linear, warmup ratio 0.05 |
| Weight decay | 0.01 |
| Optimizer | adamw_torch_fused |
| Precision | bf16 (TF32 on) |
| Max source / target tokens | 128 / 128 |
| Checkpoint selection | best eval_ibleu = 14.8031 |
| Hardware | NVIDIA GeForce RTX 5060 Ti (15.9 GB) |
| Peak GPU memory (allocated) | 12.36 GB |
| Training time | 3.42 h |
Generation with beam search (num_beams=4); held-out splits of the processed data. BLEU: sacreBLEU
corpus BLEU (13a). ROUGE: rouge_score F-measure, no stemming. BERTScore: roberta-large,
baseline-rescaled. Copy rate: output equal to the input after NFKC/whitespace normalization. Distinct-n: corpus
unique/total n-grams. iBLEU = 0.8·BLEU(ref) − 0.2·BLEU(source). The copy-source baseline outputs the input unchanged.
Evaluation metrics not found.
Qualitative examples not found.
ParaNMT-50M: Wieting & Gimpel, 2018, ParaNMT-50M: Pushing the Limits of Paraphrastic Sentence Embeddings with Millions of Machine Translations. FLAN-T5: Chung et al., 2022, Scaling Instruction-Finetuned Language Models.