2df8eb740a
- add Loss, Optimizer - change Trainer & Tester initialization interface: two styles of definition provided - handle Optimizer construction and loss function definition in a hard manner - add argparse in task-specific scripts. (seq_labeling.py & text_classify.py) - seq_labeling.py & text_classify.py work |
||
---|---|---|
.. | ||
dataloader.py | ||
example.py | ||
predict.py | ||
prepare.py | ||
README.md | ||
Word2Idx.py |
Prototype
Word2Idx.py
A mapping model between words and indexes
embedding.py
embedding modules
Contains a simple encapsulation for torch.nn.Embedding
encoder.py
encoder modules
Contains a simple encapsulation for torch.nn.LSTM
aggregation.py
aggregation modules
Contains a self-attention model, according to paper "A Structured Self-attentive Sentence Embedding", https://arxiv.org/abs/1703.03130
predict.py
predict modules
Contains a two layers perceptron for classification
example.py
An example showing how to use above modules to build a model
Contains a model for sentiment analysis on Yelp dataset, and its training and testing procedures. See https://arxiv.org/abs/1703.03130 for more details.
prepare.py
A case of using Word2Idx to build Yelp datasets
dataloader.py
A dataloader for Yelp dataset
It is an iterable object, returning a zero-padded batch every iteration.