Analysis and Optimisation of Text Generating Models
- python 3.4+
- chainer
- numpy
- keras
- argparse
- nltk (with brown corpus and wordnet data)
-
train_brown.py
: Code for running base model (no parts of speech information)- class RNNForLM: Main recurrent network taking one hot word vectors as input
- class ParallelSequentialIterator: Dataset iterator to create a batch of sequences at different positions
- class BPTTUpdater: Custom updater for truncated BackProp Through Time (BPTT)
- function compute_perplexity: Routine to rewrite the result dictionary of LogReport to add perplexity values
-
custom_classifier.py
: Classifier wrapper to setup standard classifier components (Loss function, Metrics etc) -
posword.py
: Chainer based RNN model (words + parts of speech information incorporated)- class BPTTUpdater : Custom updater for truncated BackProp Through Time (BPTT)
- class ParallelSequentialIterator: Dataset iterator to create a batch of sequences at different positions
- class Rec2Network: Main RNN model which takes word and POS tags as inputs
- class RNNForLM: Subnetwork for Rec2Network Class
- class RecNetwork: Trial RNN model, not used
- class RNNForBrown: Subnetwork for RecNetwork
- class StackedLSTMLayers: Class defining the LSTM subnetwork used in Rec2Network
- class StackedLinearLayers: Class defining the Linear layers used in Rec2Network
- function compute_perplexity: Routine to rewrite the result dictionary of LogReport to add perplexity values
-
test_recnetwork.py
: Driver program forposword.py