Coder Social home page Coder Social logo

writepoemswithlstm's Introduction

WritePoems

若使用data目录数据,则使用.txt文件里的3w多唐诗训练lstm,全部诗词不区分类别;
若使用database目录里面的数据,则包含30W+首诗,以及2w+首宋词以及诗经等,数据同时标注有平仄、作者、类别等标签;
两种数据均可用来训练模型,数据读取函数分别在文件prepare_data与database/readdb中,详细可参照代码。

使用方法:

  1. 预先安装python3.5 和 tensorflow
  2. 运行python train.py,训练模型(若跳过此步骤直接使用训练好的文件可能会有不兼容问题,详细可自行尝试)
  3. 运行write_poem函数每次运行自动生成一首诗(可能会有无法生成的情况产生,可多次运行)

writepoemswithlstm's People

Contributors

iiihunter avatar

Stargazers

 avatar

Watchers

 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.