Practical overview
When it fits
Use RE2 when you need a code-based starting point for text-pair relationship prediction and can work with its Python, PyTorch, data-preparation, and configuration workflow.
Who it is for
- Researchers studying text-pair modeling or reproducing the cited paper’s experiments.
- Developers exploring a model for natural-language inference, paraphrase identification, or answer selection.
Documented uses
- Train a text-matching model using a supplied or custom configuration.
- Prepare one of the documented benchmark datasets for experiments.
- Evaluate an existing model against a data file.
Requirements & limits
The public repository identifies the project as open source under Apache License 2.0.
- Setup requires Python 3.6 or later, pip, PyTorch, and the GloVe glove.840B.300d vectors placed in resources/.
- Benchmark use requires obtaining and preparing each dataset using the repository’s dataset-specific instructions.
- The PyTorch implementation does not support multi-GPU training.
- The README’s single-16-GB-GPU guidance applies to blocks below five with hidden size 200 and batch size 512.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Prepare RE2 and a benchmark dataset
Install the documented prerequisites and prepare one of the supported datasets for RE2.
Before you start
- Python 3.6 or later and pip
- PyTorch
- GloVe glove.840B.300d word vectors placed in resources/
- A supported dataset: SNLI, SciTail, Quora, or WikiQA
Steps
Install the Python requirements with the command below and install PyTorch.
pip install -r requirements.txtDownload the GloVe glove.840B.300d vectors and place them in
resources/.Download and unzip one supported dataset into
data/orig; for SNLI, also unzip the.gzfiles indata/orig/SNLI.From the
datadirectory, run the corresponding preparation script: the command below, the command below, the command below, or the command below.python prepare_snli.pypython prepare_scitail.pypython prepare_quora.pypython prepare_wikiqa.py
Expected outcome
The selected benchmark dataset is prepared using its dataset-specific script.
Guide limitations
- WikiQA evaluation requires separately downloading its evaluation scripts, compiling the sources in
qg-emnlp07-data/eval/trec_eval-8.0withmake -B, and moving thetrec_evalbinary intoresources/. - Multi-GPU training is not supported by this PyTorch implementation.
Train a RE2 text-matching model from a configuration
Start training using a provided or custom JSON5 experiment configuration.
Before you start
- The RE2 Python requirements, PyTorch, GloVe vectors, and prepared dataset
- A configuration file; examples are provided in
configs/
Steps
Choose a provided configuration such as
configs/main.json5, or write a configuration that namesdefaultand the relevant dataset configuration underconfigs/data.Optionally check the configuration with the command below.
python train.py $config_file.json5 --dryStart training with the command below.
python train.py $config_file.json5
Expected outcome
RE2 starts the configured training experiment; configurations in a file are executed sequentially.
Guide limitations
- Multi-GPU training is not supported. The README states a single 16G GPU is sufficient when blocks are below 5, hidden size is 200, and batch size is 512.
- The README does not specify the resulting model path for a newly trained run.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 20 November 2026
- Original website title
- alibaba-edu/simple-effective-text-matching-pytorch · Official homepage title · retained in its source language

