Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

CS-433 : Project 2

Installation • File Structure • How To Use • Examples • Credits • License

Installation

  1. Install all required packages

    pip install -r requirements.txt
  2. Install pre-commit:

    pre-commit install

File Structure

project_root/
│
├── preprocessing/
│   ├── provided/           # Preprocessing pipeline provided by the teachers
├── src/
│   ├── configs/            # HYDRA configs for training/inference hyperparamters configuration
│   ├── data/               # All function related to PyTorch datasets, dataloaders, etc.
│   ├── logger/             # Functions used for logging
│   ├── loss/               # Functions for calculating loss
│   ├── metrics/            # Functions for computing and logging metrics
│   ├── model/              # All models definitions
│   ├── trainer/            # Functions called in the training loop
│   ├── utils/              # Provided utils
├── template/               # Directory containing the extra files from the Blinorot template
│
├── train.py                # General script performing both training and inference
├── train.py                # Main training script
├── inference.py            # Script for inference
└── README.md               # Current file

How To Use

You must run all commands from the root of the project, the data should be unzipped in a ./data directory keeping the original names, example of the resulting directory tree:

project_root/
├── data/
│   ├── test_data.txt
│   ├── train_pos.txt
│   ├── train_neg.txt

To run the whole pipeline in a single command, run:

python3 run.py --config-name=CONFIG_NAME

Where CONFIG_NAME is a config from src/configs.

Alternatively, to train a model, run the following command:

python3 train.py --config-name=CONFIG_NAME

To run inference:

python3 inference.py --config-name=CONFIG_NAME

Examples

To reproduce our best results, simply run the following command using the small dataset:

python3 run.py --config-name=roberta_large

Alternatively, you can run the training and inference separately, an example is given below for the LSTM model, you can run this one with the full dataset for better results:

python3 train.py --config-name=lstm
python3 inference.py --config-name=lstm

The resulting .csv file can be found under the ./inference_results/ directory

Credits

This project was bootstrapped using the pytorch_project_template by Blinorot.

License

This project is based on the MIT-licensed pytorch_project_template by Blinorot. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages