18 Commits
Author SHA1 Message Date
Ralph Tang 3855254870 Tidy up some code (#174) 2019-02-06 13:36:48 -05:00
Ashutosh-Adhikari dc086e895f Add document classification models and datasets (#171)
* Add ReutersTrainer, ReutersEvaluator options in Factory classes

* Add Reuters to Kim-CNN command line arguments

* Fix SST dataset path according to changes in Kim-CNN args

The dataset path in args.py was made to point at the dataset folder rather than dataset/SST folder. Hence SST folder was added to paths in the SST dataset class

* Add Reuters dataset class, and support in __main__

* Add Reuters dataset trainers and evaluators

* Remove debug print statement in reuters_evaluator

* Fix rounding bug in reuters_trainer and reuters_evaluator

* Add LSTM for baseline text classification measurements

* Add eval metrics for lstm_baseline

* Set batch_first param in lstm_baseline

* Remove onnx args from lstm_baseline

* Pack padded sequences in LSTM_baseline

* Add TensorBoardX support for Reuters trainer

* Add Arxiv Academic Paper Dataset (AAPD)

* Add Hidden Bottleneck Layer to BiLSTM

* Fix packing of padded tensors in Reuters

* Add cmdline args for Hidden Bottleneck Layer for BiLSTM

* Include pre-padding lengths in AAPD dataset

* Remove duplication of preprocessing code in AAPD

* Remove batch_size condition in ReutersTrainer

* Add ignore_lengths option to ReutersTrainer and ReutersEvaluator

* Add AAPDCharQuantized and ReutersCharQuantized

* Rename Reuters_hierarchical to ReutersHierarchical

* Add CharacterCNN for document classification

* Update README.md for CharacterCNN

* Fix table in README.md for CharacterCNN

* Add AAPDHierarchical for HAN

* Update HAN for changes in Reuters dataset endpoints

* Fix bug in CharCNN when running on CPU

* Add AAPD dataset support for KimCNN

* Fix dataset paths for SST-1

* Fix dimensions of FC1 in CharCNN

* Add model checkpointing for Reuters based on F1

* Refactor LSTM baseline __main__

* Add precision, recall and F1 to Reuters evaluator

* Checkpoint only at the end of an epoch for ReutersTrainer

Add detailed log printing for dev evaluations

* Fix log_template and dev_log_template in ReutersTrainer

* Add IMDB dataset

* Fix duplicate printing of header in ReutersTrainer

* Add support for single_label datasets in ReutersTrainer

* Add support for IMDB dataset in lstm_baseline and lstm_reg

* Fix evaluator call in main method of HAN

* Add IMDB for HAN

* Fix for single_label

* Fix evaluate_dataset method for single_label datasets

* Reduce default patience to 5 epochs before early stopping

* Revert change to save_state rather than the entire model

* Add Yelp 2018 dataset

* Integrate Yelp2018 with LSTM baseline

* Replace Yelp2018 with Yelp2014 dataset

* Add Yelp2014 to LSTM Baseline

* Integrate Yelp14 into LSTM Regularization

* Remove dropout in HBL for LSTM Baseline and Reg

* Add Yelp for HAN

* Fix the saving issue for HAN

* Fix loading for HAN

* Fix typo in ReutersEvaluator

* Print to STDOUT rather than logger

* Print XML-CNN eval to STDOUT rather than logger

* Update max_length for IMDB dataset

* Add single_label support for char_cnn

* Fix evaluation method for char_cnn

* Remove unwanted parameters from ReutersTrainer and ReutersEval

* Fix code formatting in lstm_reg/args

* Add support for IMDB and Yelp in KimCNN

* Fix single_label incorporation

* Remove unnecessary conditions

* Fix num_classes in Yelp2014

* Add single_label support for XML-CNN

* Fix call to evaluator in XML-CNN

* Address PEP8 issues

* Address PEP8 issues

* Address PEP8 issues

* Address PEP8 issues
2019-01-25 13:02:37 -05:00
Achyudh Ram f0a5c370bc Fix KimCNN for SST, AAPD datasets (#157)
* Add ReutersTrainer, ReutersEvaluator options in Factory classes

* Add Reuters to Kim-CNN command line arguments

* Fix SST dataset path according to changes in Kim-CNN args

The dataset path in args.py was made to point at the dataset folder rather than dataset/SST folder. Hence SST folder was added to paths in the SST dataset class

* Add Reuters dataset class, and support in __main__

* Add Reuters dataset trainers and evaluators

* Remove debug print statement in reuters_evaluator

* Fix rounding bug in reuters_trainer and reuters_evaluator

* Add LSTM for baseline text classification measurements

* Add eval metrics for lstm_baseline

* Set batch_first param in lstm_baseline

* Remove onnx args from lstm_baseline

* Pack padded sequences in LSTM_baseline

* Add TensorBoardX support for Reuters trainer

* Add Arxiv Academic Paper Dataset (AAPD)

* Add Hidden Bottleneck Layer to BiLSTM

* Fix packing of padded tensors in Reuters

* Add cmdline args for Hidden Bottleneck Layer for BiLSTM

* Include pre-padding lengths in AAPD dataset

* Remove duplication of preprocessing code in AAPD

* Remove batch_size condition in ReutersTrainer

* Add ignore_lengths option to ReutersTrainer and ReutersEvaluator

* Add AAPDCharQuantized and ReutersCharQuantized

* Rename Reuters_hierarchical to ReutersHierarchical

* Add CharacterCNN for document classification

* Update README.md for CharacterCNN

* Fix table in README.md for CharacterCNN

* Add AAPDHierarchical for HAN

* Update HAN for changes in Reuters dataset endpoints

* Fix bug in CharCNN when running on CPU

* Add AAPD dataset support for KimCNN

* Fix dataset paths for SST-1
2018-11-05 15:42:28 -05:00
Achyudh Ram ed4f01852e Baseline LSTM implementation (#150)
* Add ReutersTrainer, ReutersEvaluator options in Factory classes

* Add Reuters to Kim-CNN command line arguments

* Fix SST dataset path according to changes in Kim-CNN args

The dataset path in args.py was made to point at the dataset folder rather than dataset/SST folder. Hence SST folder was added to paths in the SST dataset class

* Add Reuters dataset class, and support in __main__

* Add Reuters dataset trainers and evaluators

* Remove debug print statement in reuters_evaluator

* Fix rounding bug in reuters_trainer and reuters_evaluator

* Add LSTM for baseline text classification measurements

* Add eval metrics for lstm_baseline

* Set batch_first param in lstm_baseline

* Remove onnx args from lstm_baseline
2018-10-11 03:04:23 -04:00
Achyudh Ram 1b817d3e24 WIP: Add Reuters-21578 dataset (#147)
* Add ReutersTrainer, ReutersEvaluator options in Factory classes

* Add Reuters to Kim-CNN command line arguments

* Fix SST dataset path according to changes in Kim-CNN args

The dataset path in args.py was made to point at the dataset folder rather than dataset/SST folder. Hence SST folder was added to paths in the SST dataset class

* Add Reuters dataset class, and support in __main__

* Add Reuters dataset trainers and evaluators

* Remove debug print statement in reuters_evaluator

* Fix rounding bug in reuters_trainer and reuters_evaluator
2018-10-02 21:09:51 -04:00
Michael Tu 8a00f9cdcd Make Kim CNN ONNX-exportable (#136)
* Kim CNN - only set embedding for corresponding mode

* Kim CNN ONNX Export

* Specify dummy ONNX input size from command line
2018-08-04 17:30:24 -04:00
Michael Tu 82bf90f4bb Tune Kim CNN for SST-2 and Improve SST-1 Results with Dataset/Initialization Changes (#133)
* SST change min_freq and Kim CNN init distribution

* Add tuned results for SST-1 and SST-2

* Fix typo
2018-07-11 22:08:26 -04:00
Michael Tu 8563ad5976 Kim CNN OOP Refactoring (#124)
* Nuke obsolete artifacts

* Refactor Kim CNN

* Make kim_cnn a module

* Fix bugs

* Update README

* Add choices to dataset arg

* update for sst2

update sst.py

update sst.py

* Add Kim CNN dataset choices to args.py

* Update tuned SST-1 accuracy
2018-07-03 16:42:31 -04:00
Michael Tu 5cc027f03e Create Castor-level SST dataset (#123)
* Move SST to root directory datasets

* Fix bugs
2018-06-09 17:32:32 -04:00
Michael Tu f7a0167b81 Migrate to from GitHub castorini/data to uWaterloo Castor-data (#103)
* Refactor main README
* Update Anserini Dependency docs
* Update idf baseline and Kim CNN docs to use Castor-data
* Update remaining READMEs to reference Castor-data
* Change default path from data to Castor-data
* Fix wrong order of embeddings path
2018-05-23 16:16:17 -04:00
Michael Tu cbd54cb382 Kim CNN README remove torchtext reset (#96) 2018-01-18 10:42:09 -05:00
Michael Tu aaff291edb Update Kim CNN SST-1 dataset to use torchtext 0.2.0 (#81) 2017-11-07 21:37:18 -05:00
Peng Shi 4dea22b40f Deterministic CNN #45 (#71)
* Deterministic CNN #45

* Describe the data source
2017-10-30 22:23:00 -04:00
Peng Shi 511f29a2a6 kim cnn with torchtext (#59)
* kim cnn with torchtext

* model

* import style
2017-10-05 09:38:07 -04:00
Matt Crane a3294339fb Add seed and thread arguments (#43)
So that any experiments can be controlled from the command line, I've set the defaults to what they were hardcoded (for the seed) and num_threads in kim_cnn to be consistent with the default in sm_cnn.
2017-09-01 09:30:01 -04:00
rosequ d2d958cc51 Kim CNN: Early Stop Training (#40) (#41)
Stop training if there's no improvement in the accuracy over 5 epochs
2017-08-30 14:45:01 -04:00
Peng Shi 53e0de03d7 Kim's sentence classification model: Upgrade to Python 3 (#36)
Kim's sentence classification model: Upgrade to Python 3, per issue #31
2017-07-30 08:10:44 +08:00
Peng Shi 7d0a78d1a7 Kim cnn (#21)
Reimplement Kim's sentence classification model #12
2017-04-24 15:53:36 -04:00