Library / SDK
vsuthichai/paraphraser avatar
vsuthichai/paraphraser

vsuthichai/paraphraser: A TensorFlow 1.x Paraphrase Generator You Run From a Checkpoint

Sentence paraphrase generation at the sentence level

407 stars97 forksPythonMIT

At a glance

What is it?
This repository wraps a bidirectional LSTM encoder and attention decoder into a small inference script for sentence-level paraphrase generation. It is a research artifact from the Insight Data Science AI program, and its usefulness depends almost entirely on whether you can live with TensorFlow 1.4.1 and a checkpoint downloaded from Google Drive.
Who is it for?
Adopt this if you want a small, readable reference implementation of an attention-based paraphrase generator and you already have a Python 3.5 or 3.6 environment with TensorFlow 1.x. Do not adopt it as a production service: there is no pip package, no packaged model weights, and the checkpoint lives on Google Drive.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 69 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Problem: Generating a Different Sentence With the Same Meaning

Paraphrase generation is the task of taking one sentence and producing another that carries the same meaning in different words. It sits underneath data augmentation for NLP training sets, query rewriting, and duplicate detection, among other uses. The repository states that it provides paraphrase generation for sentences through a clean and simple API, with a hosted demo at pair-a-phrase.it. The audience is narrow and specific: someone who wants to run a pretrained seq2seq paraphrase model locally without building the encoder, decoder, and attention stack from scratch. This is not a library you import into a larger pipeline. It is a script plus a checkpoint. The README notes the work was developed under the Insight Data Science Artificial Intelligence program, which explains the shape of the project: a working demonstration of a technique, published with the model weights hosted externally rather than packaged for distribution.

Architecture: A Bidirectional LSTM Encoder and an Attention Decoder

The README describes the underlying model as a bidirectional LSTM encoder and LSTM decoder with attention, trained using TensorFlow. That is the standard sequence-to-sequence arrangement for text generation: the encoder reads the source sentence in both directions so that each token representation carries left and right context, and the decoder produces the paraphrase one token at a time while attending back over the encoder states. The attention mechanism is what lets the decoder align output words with the parts of the input it is rewriting, which matters more for paraphrase than for translation because the output length and word order can diverge substantially from the source. Pretrained embeddings come from John Wieting's para-nmt-50m project, cited in the README. The training data is an aggregation of public paraphrase and entailment corpora: para-nmt-5m, Quora question pairs, SNLI, and Semeval are named. The README explicitly says the aggregated dataset is not included in the repository and that you should contact the author if you want to know more. That single sentence tells you a lot about reproducibility here. You can run inference, but you cannot retrain the model to the same specification without reconstructing the dataset yourself.

Getting It Running: conda, a Checkpoint, and Two Downloads

The setup path in the README is explicit and has several manual steps. First create the environment from the repository directory with conda env create -f env.yml, then activate it with conda activate paraphraser-env. Two artifacts must be downloaded by hand. The model checkpoint comes from a Google Drive link; the README says to rename it to "checkpoints" and place it inside the /paraphraser/paraphraser directory. The para-nmt-50m embeddings come from a second Google Drive link and must be renamed to para-nmt-50m and placed inside the /paraphraser directory. The README then says you MAY need to run conda install tensorflow==1.14, conda install spacy, and python3 -m spacy download en_core_web_sm when prompted. Note the version drift: the prerequisites section lists TensorFlow 1.4.1 and Python 3.5, while the troubleshooting commands install TensorFlow 1.14. Both are TensorFlow 1.x, so the checkpoint format should be compatible, but you should expect to resolve which one your environment actually ends up with. Inference itself is one command: python inference.py --checkpoint=checkpoints/model-171856, run from inside the paraphraser directory. The single config surface is that --checkpoint flag pointing at a TensorFlow checkpoint prefix. There is no config file, no environment variable, and no server to start.

What the Repository Does Not Give You

The TODO list is the honest part of this project. It names a pip installable package, deeper layer counts, recurrent layer dropout, greater dataset augmentation, residual layers, model compression, and byte pair encoding for out-of-vocabulary words as work not yet done. Each of those has a practical consequence. Without a pip package, you cannot install this as a dependency; you clone the repository and run a script. Without byte pair encoding, the model's vocabulary is fixed by whatever the checkpoint was trained with, and any input token outside that vocabulary has no subword fallback. Without model compression, the checkpoint size and memory footprint are whatever the original training run produced. The training section states the model was trained for 2 epochs on an Nvidia GTX 1080 and evaluated on BLEU, with TensorBoard curves shown as images in the README. Two epochs on an aggregated corpus is a short run, and the README does not report a BLEU number in text. Treat the training curves as a development artifact, not as evidence of output quality. There are also no releases listed for this repository, so there is no versioned artifact to pin. You are tracking the master branch.

The TensorFlow 1.x Constraint Is the Real Adoption Cost

The hardest constraint is not the model. It is the runtime. TensorFlow 1.4.1 and Python 3.5 are both well past their support windows, and TensorFlow 1.x uses graph and session semantics that do not carry over to TensorFlow 2.x without a conversion step the README does not describe. If your organization has standardized on a modern Python and TensorFlow 2.x, this repository will not slot in. You would be maintaining a separate legacy environment, or porting the model definition yourself. The dependency on spacy adds a second moving part: the README installs en_core_web_sm, and spacy model versions are tied to spacy library versions, so a fresh install today may pull a combination the original code was never run against. The checkpoint download from Google Drive is another operational wrinkle. There is no checksum, no version tag, and no mirror. If that Drive file disappears or the author's account changes, the model is gone, and the training data needed to reproduce it is not in the repository either. For a research reference this is tolerable. For anything with an availability requirement it is disqualifying.

Where This Fits Against a Pretrained Transformer Paraphraser

The obvious alternative is a modern pretrained sequence-to-sequence model fine-tuned for paraphrase, such as a T5 or BART variant loaded through the Hugging Face transformers library. The difference in approach is not just architecture, it is packaging. A transformers-based paraphraser is a pip install plus a model identifier; the weights download automatically, the tokenizer handles subword segmentation, and the library maintains compatibility with current PyTorch or TensorFlow releases. This repository gives you neither automatic weight retrieval nor subword tokenization, and it pins you to TensorFlow 1.x. What it does give you is transparency at small scale: one Python entry point, a readable encoder-decoder definition, and a training recipe you can inspect. If your goal is to understand how attention-based paraphrase generation is assembled, or to modify the architecture for an experiment, that readability has value that a large pretrained checkpoint does not offer. If your goal is to paraphrase sentences in a running system, the transformers route removes the environment archaeology entirely. The honest framing is that this project competes on legibility, not on capability.

Licence, Maintenance, and What Two Epochs Implies

The repository is MIT licensed, which is permissive and places few restrictions on reuse, modification, or redistribution of the code. Two caveats sit outside the licence grant. The model checkpoint and the para-nmt-50m embeddings are downloaded from external Google Drive links, and the README does not state their licence terms; the para-nmt-50m project is cited to Wieting and Gimpel, so check that project's terms before using the embeddings or a model derived from them in a commercial setting. The aggregated training data is not distributed at all, so there is no data licence to review because there is no data. This is not legal advice, and the terms attached to the external artifacts are worth reading directly. On maintenance, the repository shows a push in July 2026 and no releases, so the code is alive but unversioned. Upgrading means pulling master and re-testing your checkpoint load. The practical cost of ownership is the legacy environment: every time you rebuild the conda environment, you are resolving TensorFlow 1.x, spacy, and their transitive dependencies against a package index that no longer prioritizes them. Budget for that, and for the possibility that a future spacy release breaks the en_core_web_sm install path the README describes.

Who Should Clone This, and What to Check First

Clone this if you are studying sequence-to-sequence paraphrase generation and want a compact TensorFlow implementation with attention you can read end to end, or if you have an existing TensorFlow 1.x environment and need a pretrained checkpoint for sentence-level paraphrasing. Do not clone it if you need a maintained dependency, automatic weight downloads, subword tokenization, or a reproducible training pipeline, because none of those are present. The first thing to verify is that the checkpoint downloads and that python inference.py --checkpoint=checkpoints/model-171856 loads it without a graph mismatch under whichever TensorFlow 1.x version your conda environment resolves. The second is that the para-nmt-50m file is in the directory the inference script expects, since the README places it one level above the checkpoints directory and a wrong path will fail before any generation happens. If both of those pass, you have a working paraphrase generator. If the checkpoint will not load, there is no fallback in this repository: no alternate weights, no training script for the aggregated dataset, and no release to pin to.

Editorial conclusion

Adopt this if you want a small, readable reference implementation of an attention-based paraphrase generator and you already have a Python 3.5 or 3.6 environment with TensorFlow 1.x. Do not adopt it as a production service: there is no pip package, no packaged model weights, and the checkpoint lives on Google Drive. Before committing, verify that the checkpoint named model-171856 loads against your TensorFlow build, and confirm that the para-nmt-50m embeddings file is placed where the inference script expects it.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. vsuthichai/paraphraser on GitHub
Community notes

Community notes