All Projects → wb14123 → Seq2seq Couplet

wb14123 / Seq2seq Couplet

Licence: agpl-3.0
Play couplet with seq2seq model. 用深度学习对对联。

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to Seq2seq Couplet

Neural Combinatorial Rl Pytorch
PyTorch implementation of Neural Combinatorial Optimization with Reinforcement Learning https://arxiv.org/abs/1611.09940
Stars: ✭ 329 (-93.61%)
Mutual labels:  seq2seq
Tf Seq2seq
Sequence to sequence learning using TensorFlow.
Stars: ✭ 387 (-92.48%)
Mutual labels:  seq2seq
Practical Pytorch
Go to https://github.com/pytorch/tutorials - this repo is deprecated and no longer maintained
Stars: ✭ 4,329 (-15.93%)
Mutual labels:  seq2seq
Im2latex
Image to LaTeX (Seq2seq + Attention with Beam Search) - Tensorflow
Stars: ✭ 342 (-93.36%)
Mutual labels:  seq2seq
Text Classification Models Pytorch
Implementation of State-of-the-art Text Classification Models in Pytorch
Stars: ✭ 379 (-92.64%)
Mutual labels:  seq2seq
Nlp Tutorials
Simple implementations of NLP models. Tutorials are written in Chinese on my website https://mofanpy.com
Stars: ✭ 394 (-92.35%)
Mutual labels:  seq2seq
Seq2seq Chatbot For Keras
This repository contains a new generative model of chatbot based on seq2seq modeling.
Stars: ✭ 322 (-93.75%)
Mutual labels:  seq2seq
Text Summarization Tensorflow
Tensorflow seq2seq Implementation of Text Summarization.
Stars: ✭ 527 (-89.77%)
Mutual labels:  seq2seq
Multiwoz
Source code for end-to-end dialogue model from the MultiWOZ paper (Budzianowski et al. 2018, EMNLP)
Stars: ✭ 384 (-92.54%)
Mutual labels:  seq2seq
Joeynmt
Minimalist NMT for educational purposes
Stars: ✭ 420 (-91.84%)
Mutual labels:  seq2seq
Time Series Prediction
A collection of time series prediction methods: rnn, seq2seq, cnn, wavenet, transformer, unet, n-beats, gan, kalman-filter
Stars: ✭ 351 (-93.18%)
Mutual labels:  seq2seq
Text summurization abstractive methods
Multiple implementations for abstractive text summurization , using google colab
Stars: ✭ 359 (-93.03%)
Mutual labels:  seq2seq
Neural sp
End-to-end ASR/LM implementation with PyTorch
Stars: ✭ 408 (-92.08%)
Mutual labels:  seq2seq
Pytorch Chatbot
Pytorch seq2seq chatbot
Stars: ✭ 336 (-93.47%)
Mutual labels:  seq2seq
Seq2seqchatbots
A wrapper around tensor2tensor to flexibly train, interact, and generate data for neural chatbots.
Stars: ✭ 466 (-90.95%)
Mutual labels:  seq2seq
Nl2bash
Generating bash command from natural language https://arxiv.org/abs/1802.08979
Stars: ✭ 325 (-93.69%)
Mutual labels:  seq2seq
Nmtpytorch
Sequence-to-Sequence Framework in PyTorch
Stars: ✭ 392 (-92.39%)
Mutual labels:  seq2seq
Seq2seq
Minimal Seq2Seq model with Attention for Neural Machine Translation in PyTorch
Stars: ✭ 552 (-89.28%)
Mutual labels:  seq2seq
Seq2seq.pytorch
Sequence-to-Sequence learning using PyTorch
Stars: ✭ 514 (-90.02%)
Mutual labels:  seq2seq
Tf seq2seq chatbot
[unmaintained]
Stars: ✭ 420 (-91.84%)
Mutual labels:  seq2seq

This is a project use seq2seq model to play couplets (对对联)。 This project is written with Tensorflow. You can try the demo at https://ai.binwang.me/couplet.

Pre-requirements

  • Tensorflow
  • Python 3.6
  • Dataset

Dataset

You will need some data to run this program, the dataset can be downloaded from this project.

** Note: If you are using your own dataset, you need to add <s> and <\s> as the first two line into the vocabs file. **

Usage

Train

Open couplet.py and config the file locations and hyperparams. Then run python couplet.py to train the model. You can see the training loss and bleu score at Tensorbloard. You may need to re-config learning_rate when you find the loss stops descresing. Here is an example of the loss graph:

loss graph

If you stoped the training and want to continue to train it. You can set restore_model to True and use m.train(<epoches>, start=<start>), which start is the steps you've already run.

I've trained the model on a Nivida GTX-1080 GPU for about 4 days.

Run the trained model

Open server.py and config the vocab_file and model_dir params. Then run python server.py will start a web service that can play couplet.

Or build the Docker image with Dockerfile and run it with Docker. Remember to mount the correct model file paths into the Docker container.

Examples

Here are some examples generated by this model:

上联 下联
殷勤怕负三春意 潇洒难书一字愁
如此清秋何吝酒 这般明月不须钱
天朗气清风和畅 云蒸霞蔚日光辉
梦里不知身是客 醉时已觉酒为朋
千秋月色君长看 一夜风声我自怜
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].