Catbird
is an open source paraphrase generation toolkit based on PyTorch.
Quick Start
Requirements and Installation
The project is based on PyTorch 1.5+ and Python 3.6+.
Install Catbird
The package can be installed using pip:
pip install catbird
This does not include configuration files or tools. Alternatively, you can run from the source code:
a. Clone the repository.
git clone https://github.com/AfonsoSalgadoSousa/catbird.git
b. Install dependencies. This project uses Poetry as its package manager. There should Make sure you have it installed. For more info check Poetry's official documentation. To install dependencies, simply run:
poetry install
Dataset Preparation
For now, we only work with the Quora Question Pairs dataset. It is recommended to download and extract the datasets somewhere outside the project directory and symlink the dataset root to $CATBIRD/data
as below. If your folder structure is different, you may need to change the corresponding paths in config files.
catbird
├── catbird
├── tools
├── configs
├── data
│ ├── quora
│ │ ├── quora_duplicate_questions.tsv
We use the HuggingFace Datasets library to load the datasets.
Train
poetry run python tools/train.py ${CONFIG_FILE} [optional arguments]
Example:
- Train T5 on QQP.
$ python tools/train.py configs/t5_quora.yaml