We built a Chinese poem writer based on Temporal Convolutional Networks (TCN). This paper recently indicates that a simple TCN architecture outperforms RNNs across a diverse range of tasks and datasets, while demonstrating longer effective memory. Therefore, we built this Chinese poem writer using TCN.
Python3.x (Tested with 3.5)
PyTorch (Tested with 0.4.0)
To use this code, please do:
- Clone the repo:
git clone https://github.com/jfzhang95/Chinese_Poem_Writer cd Chinese_Poem_Writer
- To try the demo code, please run:
python main.py -m fast
To train this Chinese poems writer, you can run:
python train.py
For more details, please see in train.py.
We built three poem generator modes:
- fast - it can generate each word only based on the last word.
- context - it can generate each word based on the entire previous context.
- head - it can generate Acrostic based on user inputs.
To change generator mode, you should change "fast" to "context" or "head" behind:
python main.py -m fast
python main.py -m fast
python main.py -m context
python main.py -m head
Upload generated poem into diyiziti, we can get more artistic result!
- Basic model and function
- Write a script to upload generated poem automatically
- Training our model with more and better data
We thank the authors of pytorch-tcn for making their PyTorch implementation of TCN available!