I Forged Emily Dickinson’s Poetry with an RNN

栏目: IT技术 · 发布时间: 6年前

DATA SCIENCE | MACHINE LEARNING

I Forged Emily Dickinson’s Poetry with an RNN

The end result is the fourth worst poetry in the universe!

Feb 23 ·3min read

I utilized a Recurrent Neural Network trained on the collective works of Emily Dickinson to generate new poetry. It’s not quite as bad as Vogon poetry , but it’s not quite as good as the real deal either.

I Forged Emily Dickinson’s Poetry with an RNN

Profound.

In order to make this happen, I repurposed a demonstration available here on Google Colaboratory and added a few tweaks of my own.

The interesting thing to note is that the network predicts individual characters (including punctuation and return characters) rather than words. The model wasn’t trained on the concept of words, sentences, paragraphs, etc. but appears to have picked up on it.

After training the model on a massive list of Emily Dickinson’s poems, I asked it to predict the next few characters based on the input of \n (a return character). The example poems below are what the model considered to be the most probable characters in the most probable order.

I used The Complete Project Gutenberg’s Poems to fuel the model’s training data. I fed the model a large single file, but a better approach would be to break each poem out separately before training.

Sample input poem

DESIRE.

Who never wanted, — maddest joy
   Remains to him unknown:
The banquet of abstemiousness
   Surpasses that of wine.

Within its hope, though yet ungrasped
   Desire's perfect goal,
No nearer, lest reality
   Should disenthrall thy soul.

Highlights from the generated poems

Untitled (first attempt)

Smale got wot' lost the blood.Sweec that from though moundered
And God, and-beath just are
Concomate I lest you,
    How Itemity.Who lust it glow is tere.The ridet his wait,
In privilener through till.Whose badnity what it too!
That fluen the seal that?
"Revice the atte!I failed of ancont, aganor!
Winds thou all take uthingful
Of inlit bolnow, —
But shall yet in ear,
To his these mistrancelf near,
In compentecant my little mound
Which landly guight be;I the

OH

OHPungred so smides and hold!
I doon st is can to chair, abseab,
Cancelt to perches of the ais,
And you shall not have to take
And ofter donther hell
    On thou the slope would be;If I should disappoint the eyes
That hunted take thee?
Then dinnar' revel,
Of the is lone becad.The grass die wou nettled monnetsmy
At Lavid for your theen
Berest the heaven haughty.
It was not night that way!
Sovered solemn when the East
With such a pitely children on my father's will.

not aftaing!

not aftaing!Each neighbor zoulled hours,
Araugh of surprise,
One little host in blaze below
That mast and pranor of wine.An oper for meray'mand
    And anl yet to-day, —
Could kingdows hannot a charge
    To hel she is failed syefest
Upon a thought my dairy.Why need insprites the strite;
'T was with I ever canchead,"
We usselves in her going;Of, fas it Just as that deathous
    When burness to rest.The say, I shall despaired thread, —
    A hocome to reat.Caultions

THE GAI HE MAL

THE GAI HE MAL.The old brighatedices chass Carved ther away
    Serappicabed to be a field,
And yet that ore the decture sea,
Some natire of lately row,
The plead is brigrion
Then the hurred strings the one
Than head I sailod that ang I
South through the streets came a fut
    Bereath the wing was so nore,
As if the room from through poats!

Key things to notice:

  • The model appropriately places punctuation at the end of lines.
  • The model is adding return characters and indentations to match Emily Dickinson’s style.
  • The model capitalizes the first letter on each line.
  • The model capitalizes the word “God”.
  • The model uses dashes and semicolons heavily.

These are all consequences of Emily Dickinson’s writing style as well as the format of the text file that I provided. There’s a related note from the transcriber:

“As is well documented, Emily Dickinson’s poems were edited in these early editions by her friends, better to fit the conventions of the times. In particular, her dashes, often small enough to appear as dots, became commas and semi-colons.”

以上所述就是小编给大家介绍的《I Forged Emily Dickinson’s Poetry with an RNN》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

人人都是架构师:分布式系统架构落地与瓶颈突破

人人都是架构师:分布式系统架构落地与瓶颈突破

高翔龙 / 电子工业出版社 / 2017-5 / 69

《人人都是架构师:分布式系统架构落地与瓶颈突破》并没有过多渲染系统架构的理论知识,而是切切实实站在开发一线角度,为各位读者诠释了大型网站在架构演变过程中出现一系列技术难题时的解决方案。《人人都是架构师:分布式系统架构落地与瓶颈突破》首先从分布式服务案例开始介绍,重点为大家讲解了大规模服务化场景下企业应该如何实施服务治理;然后在大流量限流/消峰案例中,笔者为大家讲解了应该如何有效地对流量实施管制,避......一起来看看 《人人都是架构师:分布式系统架构落地与瓶颈突破》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试