OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

RE2

RE2 is a Python and PyTorch implementation of a neural text-matching architecture that takes two text sequences and predicts their relationship. The repository supplies training and evaluation scripts and preparation instructions for SNLI, SciTail, Quora, and WikiQA.

Independent OpenViST project profile, based on linked sources.

RE2 — Experimenting with a general-purpose text-pair model across documented benchmark tasks
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Install the Python requirements with the command below and install PyTorch.

    Documented command
    pip install -r requirements.txt
  2. Download the GloVe glove.840B.300d vectors and place them in resources/.

  3. Download and unzip one supported dataset into data/orig; for SNLI, also unzip the .gz files in data/orig/SNLI.

  4. From the data directory, run the corresponding preparation script: the command below, the command below, the command below, or the command below.

    Documented command
    python prepare_snli.py
    Documented command
    python prepare_scitail.py
    Documented command
    python prepare_quora.py
    Documented command
    python 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.0 with make -B, and moving the trec_eval binary into resources/.
  • Multi-GPU training is not supported by this PyTorch implementation.
Source-based practical guide

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

  1. Choose a provided configuration such as configs/main.json5, or write a configuration that names default and the relevant dataset configuration under configs/data.

  2. Optionally check the configuration with the command below.

    Documented command
    python train.py $config_file.json5 --dry
  3. Start training with the command below.

    Documented command
    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.
Evidence and transparency

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