Skip to content
Generate Chinese hip-pop lyrics using GAN
Python
Branch: master
Clone or download
TobiasLee Merge pull request #8 from y52wang/master
Fix for the fully connected layer.
Latest commit 76bf8d3 Nov 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
data upload some results Aug 17, 2018
img update code Aug 17, 2018
LICENSE
README.md Update README.md Oct 25, 2018
dataloader.py
discriminator.py update code Aug 17, 2018
g_beta.py
generate_paragraph.py update code Aug 17, 2018
generator.py Fix for the fully connected layer. Nov 16, 2018
good_cases.txt
rhyme.py
seq_gan.py Fix function get_reward parameter. Oct 25, 2018
translate.py
util.py Fix (input, target) order. Oct 23, 2018

README.md

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

You can’t perform that action at this time.