From 826316231a30b1209b3bbf7f02d628924bd4a3d1 Mon Sep 17 00:00:00 2001 From: kadirnar Date: Sat, 15 Jul 2023 20:04:39 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=F0=9F=8E=AF=20Added=20Concise=20an?= =?UTF-8?q?d=20Informative=20README=20for=20SNLI=20Classifier=20Training?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 📘🚀 Introduced a comprehensive README outlining the project overview and detailed usage instructions for the SNLI Classifier training scripts. --- legacy/snli/README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 legacy/snli/README.md diff --git a/legacy/snli/README.md b/legacy/snli/README.md new file mode 100644 index 0000000000..2da5104975 --- /dev/null +++ b/legacy/snli/README.md @@ -0,0 +1,42 @@ +# PyTorch-based NLI Training with SNLI + +## 📝 Overview + +This repository contains Python scripts to train a Natural Language Inference (NLI) model, specifically the `SNLIClassifier`, using the Stanford Natural Language Inference (SNLI) corpus. The trained model predicts textual entailment, identifying if a statement is entailed, contradicted, or neither by another statement. + +## ⚙️ Dependencies + +Install the necessary Python libraries with: + +```bash +pip install -r requirements.txt +``` + +The `requirements.txt` file includes: + +``` +torch +torchtext +spacy +``` + +## 💻 Usage + +Start the training process with: + +```bash +python train.py --lower --word-vectors [PATH_TO_WORD_VECTORS] --vector-cache [PATH_TO_VECTOR_CACHE] --epochs [NUMBER_OF_EPOCHS] --batch-size [BATCH_SIZE] --save-path [PATH_TO_SAVE_MODEL] --gpu [GPU_NUMBER] +``` + +## 🏋️‍♀️ Training + +The script trains the model on mini-batches of data across a specified number of epochs. It saves the best-performing model on the validation set as a `.pt` file in the specified directory. + +## 📚 Scripts + +- `model.py`: Defines the `SNLIClassifier` model and auxiliary classes. +- `util.py`: Contains utility functions for directory creation and command-line argument parsing. + +## 📣 Note + +Ensure the `model.py` and `util.py` scripts are available in your working directory. \ No newline at end of file