From 0a3ce7015c1612e913433566d4ef6a18a6c861c1 Mon Sep 17 00:00:00 2001 From: rosequ Date: Tue, 5 Dec 2017 21:58:55 -0500 Subject: [PATCH] Update readme (#90) * updated readme for easier replication * updated cd changes * link change --- sm_cnn/README.md | 23 ++++++++++++++++++++++- sm_cnn/__init.py__.py | 0 sm_cnn/train.py | 1 - 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 sm_cnn/__init.py__.py diff --git a/sm_cnn/README.md b/sm_cnn/README.md index c416852..3853b70 100644 --- a/sm_cnn/README.md +++ b/sm_cnn/README.md @@ -39,6 +39,26 @@ You should you see the following tree: └── word2vec ``` +Parse the TrecQA datset: +```bash +cd ../../data/TrecQA/ +python parse.py +cd - +``` + +Parse the WikiQA datset: +```bash +cd ../../data/WikiQA/ +unzip WikiQACorpus.zip +python create-train-dev-test-data.py +cd - +``` + +Your repository root should be in your `PYTHONPATH` environment variable: +```bash +export PYTHONPATH=$(pwd) +``` + To create the dataset: ```bash cd Castor/sm_cnn/ @@ -51,10 +71,11 @@ We use `trec_eval` for evaluation: ```bash cd ../utils/ ./get_trec_eval.sh +cd ../sm_cnn ``` ### Training -Download the word2vec model from [here] (https://drive.google.com/file/d/0B2u_nClt6NbzUmhOZU55eEo4QWM/view?usp=sharing) +Download the word2vec model from [here](https://drive.google.com/file/d/0B2u_nClt6NbzUmhOZU55eEo4QWM/view?usp=sharing) and copy it to the `data/` folder. You can train the SM model for the 4 following configurations: diff --git a/sm_cnn/__init.py__.py b/sm_cnn/__init.py__.py new file mode 100644 index 0000000..e69de29 diff --git a/sm_cnn/train.py b/sm_cnn/train.py index 768cedc..326bd22 100644 --- a/sm_cnn/train.py +++ b/sm_cnn/train.py @@ -12,7 +12,6 @@ from model import SmPlusPlus from utils.relevancy_metrics import get_map_mrr from trec_dataset import TrecDataset from wiki_dataset import WikiDataset -from evaluate import evaluate args = get_args() config = args