Giter VIP home page Giter VIP logo

poetry's Introduction

Poetry

1. Introduction

A RNN model to automatically generate Chinese ancient poems with the input of start words. The idea is inspired by Weiyi Zheng's tangshi-rnn and Andrej Karpathy's Char-RNN.

2. Samples

1)             2)             3)             4)
白鹭窥鱼立,    一夜北风紧,    迟日江山丽,     去年今日此门中,
梅花晚少寒。    空山风雨寒。    无人入梦新。     白发春风未可怜。
青山犹出处,    山中有秋竹,    风霜独有路,     一笑一声天下去,
新月未无花。    风月更清香。    一月几人多。     自思春意又人心。
世事如收去,
相逢未自知。

3. Train and make poems

python main.py '一夜北风紧,' -p 100

Train a model If no available one exists or just load it and use the model to make poems. Generate a word2vec model and use the result to init the embedding layer weights of the rnn model. The model stacked 2 LSTM modules, each with 512 neurons. And 0.2 dropout rate while training. Please view the code to get more details.

4. Data

Only use a small part of Quan-Tang-Shi and Quan-Song-Shi.

5. Todo

A lot, such as adding rhythm.

poetry's People

Contributors

chaospku avatar gaoxiang-zhang avatar

Watchers

James Cloos avatar chaiyinggg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.