Coder Social home page Coder Social logo

chinese-hip-pop-generation's Introduction

Chinese Hip-pop Generation

2018 DeeCamp 人工智能夏令营项目,使用 GAN 进行中文嘻哈歌词生成。

Project of DeeCamp 2018, generating Chinese hip-pop lyrics using GAN.

Note

因时间仓促,代码写的有些混乱(诸如变量命名 etc.),也可能存在一些错误,欢迎提 PR 共同改进。未来会继续完善(重构)这个 project。

The code is a mess right now, please be careful when using. It is welcome to make a PR if you find some mistakes. I'll do code refactoring in the future.

Dataset

训练数据以及押韵表可以从 Google 云下载,也可以可以根据我的博客说明更改数据集

The processed training data and rhyme table can be downloaded from Goolge Drive, the origin lyrics (10, 000 sentence) is also provided.

Requirements

  • Python3
  • TensorFlow >= 1.7.0
  • Jieba

Model

模型基于 SeqGAN,进行一些修改:

Model

Training and Evaluate

下载数据集之后将 data 放在项目目录下,运行

python3 seq_gan.py

完成训练之后,使用运行 translate.py 查看生成的测试集结果,或者使用 generate_paragraph.py 测试生成多句效果。

Note: CPU version tensorflow may meet problem when doing inference due to tf.multinomial. You can change the sampling function in generator.py

Results

下面是一些比较好的结果,Input 为模型输入(均为测试集中的句子,未参与训练),Result 为模型生成结果,Origin 为原歌词。

Example 1:

Input:

不是乐理专修

Result:

做点儿曲式研究 我们的力量来自宇宙 自己的节奏

Origin:

所有听的观众打破他们传统 进到环球 继续让你感受

Example 2:

Input:

音响里换首咏叹听

Result:

冷酷如透明的冰 反抗的标语文艺复兴 你唱的听不清

Origin:

音响里换首咏叹听 技巧 强你 从来不需要靠垄断赢

Example 3:

Input:

自己就带上了有色眼镜

Result:

金钱摧毁多少事情 瓦解你的中枢神经

Origin: 我只想把世界分的更清 却发现自己却模糊了心

更多结果可以在 good_cases.txt 中查看

Acknowledgement

Thanks to our team: lihao2333llluckygirlrhy张林峰FrankLiuliuaiting

chinese-hip-pop-generation's People

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.