• 循环神经网络RNNLM续写“The meaning of life“


    一、语料库

    使用泰戈尔飞鸟集,作为一本英文诗集,用于续写The meaning of life比较好。

    飞鸟集语料库如下

    1. 1
    2. Stray birds of summer come to my window to sing and fly away.
    3. And yellow leaves of autumn, which have no songs, flutter and
    4. fall there with a sigh.
    5. 2
    6. O troupe of little vagrants of the world, leave your footprints
    7. in my words.
    8. 3
    9. The world puts off its mask of vastness to its lover.
    10. It becomes small as one song, as one kiss of the eternal.
    11. 4
    12. It is the tears of the earth that keep her smiles in bloom.
    13. 5
    14. The mighty desert is burning for the love of a blade of grass who
    15. shakes her head and laughs and flies away.
    16. 6
    17. If you shed tears when you miss the sun, you also miss the stars.
    18. 7
    19. The sands in your way beg for your song and your movement,
    20. dancing water. Will you carry the burden of their lameness?
    21. 8
    22. Her wistful face haunts my dreams like the rain at night.
    23. 9
    24. Once we dreamt that we were strangers.
    25. We wake up to find that we were dear to each other.
    26. 10
    27. Sorrow is hushed into peace in my heart like the evening among
    28. the silent trees.
    29. 11
    30. Some unseen fingers, like idle breeze, are playing upon my heart
    31. the music of the ripples.
    32. 12
    33. "What language is thine, O sea?"
    34. "The language of eternal question."
    35. "What language is thy answer, O sky?
    36. "The language of eternal silence."
    37. 13
    38. Listen, my heart, to the whispers of the world with which it
    39. makes love to you.
    40. 14
    41. The mystery of creation is like the darkness of night--it is
    42. great. Delusions of knowledge are like the fog of the morning.
    43. 15
    44. Do not seat your love upon a precipice because it is high.
    45. 16
    46. I sit at my window this morning where the world like a passer-by
    47. stops for a moment, nods to me and goes.
    48. 17
    49. These little thoughts are the rustle of leaves; they have their
    50. whisper of joy in my mind.
    51. 18
    52. What you are you do not see, what you see is your shadow.
    53. 19
    54. My wishes are fools, they shout across thy songs, my Master.
    55. Let me but listen.
    56. 20
    57. I cannot choose the best.
    58. The best chooses me.
    59. 21
    60. They throw their shadows before them who carry their lantern on
    61. their back.
    62. 22
    63. That I exist is a perpetual surprise which is life.
    64. 23
    65. "We, the rustling leaves, have a voice that answers the storms,
    66. but who are you so silent?"
    67. "I am a mere flower."
    68. 24
    69. Rest belongs to the work as the eyelids to the eyes.
    70. 25
    71. Man is a born child, his power is the power of growth.
    72. 26
    73. God expects answers for the flowers he sends us, not for the sun
    74. and the earth.
    75. 27
    76. The light that plays, like a naked child, among the green leaves
    77. happily knows not that man can lie.
    78. 28
    79. O Beauty, find thyself in love, not in the flattery of thy
    80. mirror.
    81. 29
    82. My heart beats her waves at the shore of the world and writes
    83. upon it her signature in tears with the words, "I love thee."
    84. 30
    85. "Moon, for what do you wait?"
    86. "To salute the sun for whom I must make way."
    87. 31
    88. The trees come up to my window like the yearning voice of the
    89. dumb earth.
    90. 32
    91. His own mornings are new surprises to God.
    92. 33
    93. Life finds its wealth by the claims of the world, and its worth
    94. by the claims of love.
    95. 34
    96. The dry river-bed finds no thanks for its past.
    97. 35
    98. The bird wishes it were a cloud. The cloud wishes it were a
    99. bird.
    100. 36
    101. The waterfall sings, "I find my song, when I find my freedom."
    102. 37
    103. I cannot tell why this heart languishes in silence.
    104. It is for small needs it never asks, or knows or remembers.
    105. 38
    106. Woman, when you move about in your household service your limbs
    107. sing like a hill stream among its pebbles.
    108. 39
    109. The sun goes to cross the Western sea, leaving its last
    110. salutation to the East.
    111. 40
    112. Do not blame your food because you have no appetite.
    113. 41
    114. The trees, like the longings of the earth, stand a-tiptoe to peep
    115. at the heaven.
    116. 42
    117. You smiled and talked to me of nothing and I felt that for this I
    118. had been waiting long.
    119. 43
    120. The fish in the water is silent, the animal on the earth is
    121. noisy, the bird in the air is singing,
    122. But Man has in him the silence of the sea, the noise of the earth
    123. and the music of the air.
    124. 44
    125. The world rushes on over the strings of the lingering heart
    126. making the music of sadness.
    127. 45
    128. He has made his weapons his gods. When his weapons win he is
    129. defeated himself.
    130. 46
    131. God finds himself by creating.
    132. 47
    133. Shadow, with her veil drawn, follows Light in secret meekness,
    134. with her silent steps of love.
    135. 48
    136. The stars are not afraid to appear like fireflies.
    137. 49
    138. I thank thee that I am none of the wheels of power but I am one
    139. with the living creatures that are crushed by it.
    140. 50
    141. The mind, sharp but not broad, sticks at every point but does not
    142. move.
    143. 51
    144. Your idol is shattered in the dust to prove that God's dust is
    145. greater than your idol.
    146. 52
    147. Man does not reveal himself in his history, he struggles up
    148. through it.
    149. 53
    150. While the glass lamp rebukes the earthen for calling it cousin,
    151. the moon rises, and the glass lamp, with a bland smile, calls
    152. her, "My dear, dear sister."
    153. 54
    154. Like the meeting of the seagulls and the waves we meet and come
    155. near. The seagulls fly off, the waves roll away and we depart.
    156. 55
    157. My day is done, and I am like a boat drawn on the beach,
    158. listening to the dance-music of the tide in the evening.
    159. 56
    160. Life is given to us, we earn it by giving it.
    161. 57
    162. We come nearest to the great when we are great in humility.
    163. 58
    164. The sparrow is sorry for the peacock at the burden of its tail.
    165. 59
    166. Never be afraid of the moments--thus sings the voice of the
    167. everlasting.
    168. 60
    169. The hurricane seeks the shortest road by the no-road, and
    170. suddenly ends its search in the Nowhere.
    171. 61
    172. Take my wine in my own cup, friend.
    173. It loses its wreath of foam when poured into that of others.
    174. 62
    175. The Perfect decks itself in beauty for the love of the Imperfect.
    176. 63
    177. God says to man, "I heal you therefore I hurt, love you therefore
    178. punish."
    179. 64
    180. Thank the flame for its light, but do not forget the lampholder
    181. standing in the shade with constancy of patience.
    182. 65
    183. Tiny grass, your steps are small, but you possess the earth under
    184. your tread.
    185. 66
    186. The infant flower opens its bud and cries, "Dear World, please do
    187. not fade."
    188. 67
    189. God grows weary of great kingdoms, but never of little flowers.
    190. 68
    191. Wrong cannot afford defeat but Right can.
    192. 69
    193. "I give my whole water in joy," sings the waterfall, "though
    194. little of it is enough for the thirsty."
    195. 70
    196. Where is the fountain that throws up these flowers in a ceaseless
    197. outbreak of ecstasy?
    198. 71
    199. The woodcutter's axe begged for its handle from the tree.
    200. The tree gave it.
    201. 72
    202. In my solitude of heart I feel the sigh of this widowed evening
    203. veiled with mist and rain.
    204. 73
    205. Chastity is a wealth that comes from abundance of love.
    206. 74
    207. The mist, like love, plays upon the heart of the hills and brings
    208. out surprises of beauty.
    209. 75
    210. We read the world wrong and say that it deceives us.
    211. 76
    212. The poet wind is out over the sea and the forest to seek his own
    213. voice.
    214. 77
    215. Every child comes with the message that God is not yet
    216. discouraged of man.
    217. 78
    218. The grass seeks her crowd in the earth.
    219. The tree seeks his solitude of the sky.
    220. 79
    221. Man barricades against himself.
    222. 80
    223. Your voice, my friend, wanders in my heart, like the muffled
    224. sound of the sea among these listening pines.
    225. 81
    226. What is this unseen flame of darkness whose sparks are the stars?
    227. 82
    228. Let life be beautiful like summer flowers and death like autumn
    229. leaves.
    230. 83
    231. He who wants to do good knocks at the gate; he who loves finds
    232. the gate open.
    233. 84
    234. In death the many becomes one; in life the one becomes many.
    235. Religion will be one when God is dead.
    236. 85
    237. The artist is the lover of Nature, therefore he is her slave and
    238. her master.
    239. 86
    240. "How far are you from me, O Fruit?"
    241. "I am hidden in your heart, O Flower."
    242. 87
    243. This longing is for the one who is felt in the dark, but not seen
    244. in the day.
    245. 88
    246. "You are the big drop of dew under the lotus leaf, I am the
    247. smaller one on its upper side," said the dewdrop to the lake.
    248. 89
    249. The scabbard is content to be dull when it protects the keenness
    250. of the sword.
    251. 90
    252. In darkness the One appears as uniform; in the light the One
    253. appears as manifold.
    254. 91
    255. The great earth makes herself hospitable with the help of the
    256. grass.
    257. 92
    258. The birth and death of the leaves are the rapid whirls of the
    259. eddy whose wider circles move slowly among stars.
    260. 93
    261. Power said to the world, "You are mine.
    262. The world kept it prisoner on her throne.
    263. Love said to the world, "I am thine."
    264. The world gave it the freedom of her house.
    265. 94
    266. The mist is like the earth's desire. It hides the sun for whom
    267. she cries.
    268. 95
    269. Be still, my heart, these great trees are prayers.
    270. 96
    271. The noise of the moment scoffs at the music of the Eternal.
    272. 97
    273. I think of other ages that floated upon the stream of life and
    274. love and death and are forgotten, and I feel the freedom of
    275. passing away.
    276. 98
    277. The sadness of my soul is her bride's veil.
    278. It waits to be lifted in the night.
    279. 99
    280. Death's stamp gives value to the coin of life; making it possible
    281. to buy with life what is truly precious.
    282. 100
    283. The cloud stood humbly in a corner of the sky.
    284. The morning crowned it with splendour.
    285. 101
    286. The dust receives insult and in return offers her flowers.
    287. 102
    288. Do not linger to gather flowers to keep them, but walk on, for
    289. flowers will keep themselves blooming all your way.
    290. 103
    291. Roots are the branches down in the earth.
    292. Branches are roots in the air.
    293. 104
    294. The music of the far-away summer flutters around the Autumn
    295. seeking its former nest.
    296. 105
    297. Do not insult your friend by lending him merits from your own
    298. pocket.
    299. 106
    300. The touch of the nameless days clings to my heart like mosses
    301. round the old tree.
    302. 107
    303. The echo mocks her origin to prove she is the original.
    304. 108
    305. God is ashamed when the prosperous boasts of His special favour.
    306. 109
    307. I cast my own shadow upon my path, because I have a lamp that has
    308. not been lighted.
    309. 110
    310. Man goes into the noisy crowd to drown his own clamour of
    311. silence.
    312. 111
    313. That which ends in exhaustion is death, but the perfect ending is
    314. in the endless.
    315. 112
    316. The sun has his simple robe of light. The clouds are decked with
    317. gorgeousness.
    318. 113
    319. The hills are like shouts of children who raise their arms,
    320. trying to catch stars.
    321. 114
    322. The road is lonely in its crowd for it is not loved.
    323. 115
    324. The power that boasts of its mischiefs is laughed at by the
    325. yellow leaves that fall, and clouds that pass by.
    326. 116
    327. The earth hums to me to-day in the sun, like a woman at her
    328. spinng, some ballad of the ancient time in a forgotten tongue.
    329. 117
    330. The grass-blade is worth of the great world where it grows.
    331. 118
    332. Dream is a wife who must talk.
    333. Sleep is a husband who silently suffers.
    334. 119
    335. The night kisses the fading day whispering to his ear, "I am
    336. death, your mother. I am to give you fresh birth."
    337. 120
    338. I feel, thy beauty, dark night, like that of the loved woman when
    339. she has put out the lamp.
    340. 121
    341. I carry in my world that flourishes the worlds that have failed.
    342. 122
    343. Dear friend, I feel the silence of your great thoughts of may a
    344. deepening eventide on this beach when I listen to these waves.
    345. 123
    346. The bird thinks it is an act of kindness to give the fish a lift
    347. in the air.
    348. 124
    349. "In the moon thou sendest thy love letters to me," said the night
    350. to the sun.
    351. "I leave my answers in tears upon the grass."
    352. 125
    353. The Great is a born child; when he dies he gives his great
    354. childhood to the world.
    355. 126
    356. Not hammerstrokes, but dance of the water sings the pebbles into
    357. perfection.
    358. 127
    359. Bees sip honey from flowers and hum their thanks when they leave.
    360. The gaudy butterfly is sure that the flowers owe thanks to him.
    361. 128
    362. To be outspoken is easy when you do not wait to speak the
    363. complete truth.
    364. 129
    365. Asks the Possible to the Impossible, "Where is your dwelling
    366. place?"
    367. "In the dreams of the impotent," comes the answer.
    368. 130
    369. If you shut your door to all errors truth will be shut out.
    370. 131
    371. I hear some rustle of things behind my sadness of heart,--I
    372. cannot see them.
    373. 132
    374. Leisure in its activity is work.
    375. The stillness of the sea stirs in waves.
    376. 133
    377. The leaf becomes flower when it loves.
    378. The flower becomes fruit when it worships.
    379. 134
    380. The roots below the earth claim no rewards for making the
    381. branches fruitful.
    382. 135
    383. This rainy evening the wind is restless.
    384. I look at the swaying branches and ponder over the greatness of
    385. all things.
    386. 136
    387. Storm of midnight, like a giant child awakened in the untimely
    388. dark, has begun to play and shout.
    389. 137
    390. Thou raisest thy waves vainly to follow thy lover. O sea, thou
    391. lonely bride of the storm.
    392. 138
    393. "I am ashamed of my emptiness," said the Word to the Work.
    394. "I know how poor I am when I see you," said the Work to the Word.
    395. 139
    396. Time is the wealth of change, but the clock in its parody makes
    397. it mere change and no wealth.
    398. 140
    399. Truth in her dress finds facts too tight.
    400. In fiction she moves with ease.
    401. 141
    402. When I travelled to here and to there, I was tired of thee, O
    403. Road, but now when thou leadest me to everywhere I am wedded to
    404. thee in love.
    405. 142
    406. Let me think that there is one among those stars that guides my
    407. life through the dark unknown.
    408. 143
    409. Woman, with the grace of your fingers you touched my things and
    410. order came out like music.
    411. 144
    412. One sad voice has its nest among the ruins of the years.
    413. It sings to me in the night,--"I loved you."
    414. 145
    415. The flaming fire warns me off by its own glow.
    416. Save me from the dying embers hidden under ashes.
    417. 146
    418. I have my stars in the sky,
    419. But oh for my little lamp unlit in my house.
    420. 147
    421. The dust of the dead words clings to thee.
    422. Wash thy soul with silence.
    423. 148
    424. Gaps are left in life through which comes the sad music of death.
    425. 149
    426. The world has opened its heart of light in the morning.
    427. Come out, my heart, with thy love to meet it.
    428. 150
    429. My thoughts shimmer with these shimmering leaves and my heart
    430. sings with the touch of this sunlight; my life is glad to be
    431. floating with all things into the blue of space, into the dark of
    432. time.
    433. 151
    434. God's great power is in the gentle breeze, not in the storm.
    435. 152
    436. This is a dream in which things are all loose and they oppress.
    437. I shall find them gathered in thee when I awake and shall be
    438. free.
    439. 153
    440. "Who is there to take up my duties?" asked the setting sun.
    441. "I shall do what I can, my Master," said the earthen lamp.
    442. 154
    443. By plucking her petals you do not gather the beauty of the
    444. flower.
    445. 155
    446. Silence will carry your voice like the nest that holds the
    447. sleeping birds.
    448. 156
    449. The Great walks with the Small without fear.
    450. The Middling keeps aloof.
    451. 157
    452. The night opens the flowers in secret and allows the day to get
    453. thanks.
    454. 158
    455. Power takes as ingratitude the writhings of its victims.
    456. 159
    457. When we rejoice in our fulness, then we can part with our fruits
    458. with joy.
    459. 160
    460. The raindrops kissed the earth and whispered,--"We are thy
    461. homesick children, mother, come back to thee from the heaven."
    462. 161
    463. The cobweb pretends to catch dew-drops and catches flies.
    464. 162
    465. Love! when you come with the burning lamp of pain in your hand,
    466. I can see your face and know you as bliss.
    467. 163
    468. "The learned say that your lights will one day be no more." said
    469. the firefly to the stars.
    470. The stars made no answer.
    471. 164
    472. In the dusk of the evening the bird of some early dawn comes to
    473. the nest of my silence.
    474. 165
    475. Thoughts pass in my mind like flocks of ducks in the sky.
    476. I hear the voice of their wings.
    477. 166
    478. The canal loves to think that rivers exist solely to supply it
    479. with water.
    480. 167
    481. The world has kissed my soul with its pain, asking for its return
    482. in songs.
    483. 168
    484. That which oppresses me, is it my soul trying to come out in the
    485. open, or the soul of the world knocking at my heart for its
    486. entrance?
    487. 169
    488. Thought feeds itself with its own words and grows.
    489. 170
    490. I have dipped the vessel of my heart into this silent hour; it
    491. has filled with love.
    492. 171
    493. Either you have work or you have not.
    494. When you have to say, "Let us do something," then begins
    495. mischief.
    496. 172
    497. The sunflower blushed to own the nameless flower as her kin.
    498. The sun rose and smiled on it, saying, "Are you well, my
    499. darling?"
    500. 173
    501. "Who drives me forward like fate?"
    502. "The Myself striding on my back."
    503. 174
    504. The clouds fill the watercups of the river, hiding themselves in
    505. the distant hills.
    506. 175
    507. I spill water from my water jar as I walk on my way,
    508. Very little remains for my home.
    509. 176
    510. The water in a vessel is sparkling; the water in the sea is dark.
    511. The small truth has words that are clear; the great truth has
    512. great silence.
    513. 177
    514. Your smile was the flowers of your own fields, your talk was the
    515. rustle of your own mountain pines, but your heart was the woman
    516. that we all know.
    517. 178
    518. It is the little things that I leave behind for my loved ones,--
    519. great things are for everyone.
    520. 179
    521. Woman, thou hast encircled the world's heart with the depth of
    522. thy tears as the sea has the earth.
    523. 180
    524. The sunshine greets me with a smile. The rain, his sad sister,
    525. talks to my heart.
    526. 181
    527. My flower of the day dropped its petals forgotten.
    528. In the evening it ripens into a golden fruit of memory.
    529. 182
    530. I am like the road in the night listening to the footfalls of its
    531. memories in silence.
    532. 183
    533. The evening sky to me is like a window, and a lighted lamp, and a
    534. waiting behind it.
    535. 184
    536. He who is too busy doing good finds no time to be good.
    537. 185
    538. I am the autumn cloud, empty of rain, see my fulness in the field
    539. of ripened rice.
    540. 186
    541. They hated and killed and men praised them.
    542. But God in shame hastens to hide its memory under the green
    543. grass.
    544. 187
    545. Toes are the fingers that have forsaken their past.
    546. 188
    547. Darkness travels towards light, but blindness towards death.
    548. 189
    549. The pet dog suspects the universe for scheming to take its place.
    550. 190
    551. Sit still my heart, do not raise your dust.
    552. Let the world find its way to you.
    553. 191
    554. The bow whispers to the arrow before it speeds forth--"Your
    555. freedom is mine."
    556. 192
    557. Woman, in your laughter you have the music of the fountain of
    558. life.
    559. 193
    560. A mind all logic is like a knife all blade.
    561. It makes the hand bleed that uses it.
    562. 194
    563. God loves man's lamp lights better than his own great stars.
    564. 195
    565. This world is the world of wild storms kept tame with the music
    566. of beauty.
    567. 196
    568. "My heart is like the golden casket of thy kiss," said the sunset
    569. cloud to the sun.
    570. 197
    571. By touching you may kill, by keeping away you may possess.
    572. 198
    573. The cricket's chirp and the patter of rain come to me through the
    574. dark, like the rustle of dreams from my past youth.
    575. 199
    576. "I have lost my dewdrop," cries the flower to the morning sky
    577. that has lost all its stars.
    578. 200
    579. The burning log bursts in flame and cries,--"This is my flower,
    580. my death."
    581. 201
    582. The wasp thinks that the honey-hive of the neighbouring bees is
    583. too small.
    584. His neighbours ask him to build one still smaller.
    585. 202
    586. "I cannot keep your waves," says the bank to the river.
    587. "Let me keep your footprints in my heart."
    588. 203
    589. The day, with the noise of this little earth, drowns the silence
    590. of all worlds.
    591. 204
    592. The song feels the infinite in the air, the picture in the earth,
    593. the poem in the air and the earth;
    594. For its words have meaning that walks and music that soars.
    595. 205
    596. When the sun goes down to the West, the East of his morning
    597. stands before him in silence.
    598. 206
    599. Let me not put myself wrongly to my world and set it against me.
    600. 207
    601. Praise shames me, for I secretly beg for it.
    602. 208
    603. Let my doing nothing when I have nothing to do become untroubled
    604. in its depth of peace like the evening in the seashore when the
    605. water is silent.
    606. 209
    607. Maiden, your simplicity, like the blueness of the lake, reveals
    608. your depth of truth.
    609. 210
    610. The best does not come alone. It comes with the company of the
    611. all.
    612. 211
    613. God's right hand is gentle, but terrible is his left hand.
    614. 212
    615. My evening came among the alien trees and spoke in a language
    616. which my morning stars did not know.
    617. 213
    618. Night's darkness is a bag that bursts with the gold of the dawn.
    619. 214
    620. Our desire lends the colours of the rainbow to the mere mists and
    621. vapours of life.
    622. 215
    623. God waits to win back his own flowers as gifts from man's hands.
    624. 216
    625. My sad thoughts tease me asking me their own names.
    626. 217
    627. The service of the fruit is precious, the service of the flower
    628. is sweet, but let my service be the service of the leaves in its
    629. shade of humble devotion.
    630. 218
    631. My heart has spread its sails to the idle winds for the shadowy
    632. island of Anywhere.
    633. 219
    634. Men are cruel, but Man is kind.
    635. 220
    636. Make me thy cup and let my fulness be for thee and for thine.
    637. 221
    638. The storm is like the cry of some god in pain whose love the
    639. earth refuses.
    640. 222
    641. The world does not leak because death is not a crack.
    642. 223
    643. Life has become richer by the love that has been lost.
    644. 224
    645. My friend, your great heart shone with the sunrise of the East
    646. like the snowy summit of a lonely hill in the dawn.
    647. 225
    648. The fountain of death makes the still water of life play.
    649. 226
    650. Those who have everything but thee, my God, laugh at those who
    651. have nothing but thyself.
    652. 227
    653. The movement of life has its rest in its own music.
    654. 228
    655. Kicks only raise dust and not crops from the earth.
    656. 229
    657. Our names are the light that glows on the sea waves at night and
    658. then dies without leaving its signature.
    659. 230
    660. Let him only see the thorns who has eyes to see the rose.
    661. 231
    662. Set bird's wings with gold and it will never again soar in the
    663. sky.
    664. 232
    665. The same lotus of our clime blooms here in the alien water with
    666. the same sweetness, under another name.
    667. 233
    668. In heart's perspective the distance looms large.
    669. 234
    670. The moon has her light all over the sky, her dark spots to
    671. herself.
    672. 235
    673. Do not say, "It is morning," and dismiss it with a name of
    674. yesterday. See it for the first time as a new-born child that
    675. has no name.
    676. 236
    677. Smoke boasts to the sky, and Ashes to the earth, that they are
    678. brothers to the fire.
    679. 237
    680. The raindrop whispered to the jasmine, "Keep me in your heart for
    681. ever."
    682. The jasmine sighed, "Alas," and dropped to the ground.
    683. 238
    684. Timid thoughts, do not be afraid of me.
    685. I am a poet.
    686. 239
    687. The dim silence of my mind seems filled with crickets' chirp--the
    688. grey twilight of sound.
    689. 240
    690. Rockets, your insult to the stars follows yourself back to the
    691. earth.
    692. 241
    693. Thou hast led me through my crowded travels of the day to my
    694. evening's loneliness.
    695. I wait for its meaning through the stillness of the night.
    696. 242
    697. This life is the crossing of a sea, where we meet in the same
    698. narrow ship.
    699. In death we reach the shore and go to our different worlds.
    700. 243
    701. The stream of truth flows through its channels of mistakes.
    702. 244
    703. My heart is homesick to-day for the one sweet hour across the sea
    704. of time.
    705. 245
    706. The bird-song is the echo of the morning light back from the
    707. earth.
    708. 246
    709. "Are you too proud to kiss me?" the morning light asks the
    710. buttercup.
    711. 247
    712. "How may I sing to thee and worship, O Sun?" asked the little
    713. flower.
    714. "By the simple silence of thy purity," answered the sun.
    715. 248
    716. Man is worse than an animal when he is an animal.
    717. 249
    718. Dark clouds become heaven's flowers when kissed by light.
    719. 250
    720. Let not the sword-blade mock its handle for being blunt.
    721. 251
    722. The night's silence, like a deep lamp, is burning with the light
    723. of its milky way.
    724. 252
    725. Around the sunny island of Life swells day and night death's
    726. limitless song of the sea.
    727. 253
    728. Is not this mountain like a flower, with its petals of hills,
    729. drinking the sunlight?
    730. 254
    731. The real with its meaning read wrong and emphasis misplaced is
    732. the unreal.
    733. 255
    734. Find your beauty, my heart, from the world's movement, like the
    735. boat that has the grace of the wind and the water.
    736. 256
    737. The eyes are not proud of their sight but of their eyeglasses.
    738. 257
    739. I live in this little world of mine and am afraid to make it the
    740. least less. Lift me into thy world and let me have the freedom
    741. gladly to lose my all.
    742. 258
    743. The false can never grow into truth by growing in power.
    744. 259
    745. My heart, with its lapping waves of song, longs to caress this
    746. green world of the sunny day.
    747. 260
    748. Wayside grass, love the star, then your dreams will come out in
    749. flowers.
    750. 261
    751. Let your music, like a sword, pierce the noise of the market to
    752. its heart.
    753. 262
    754. The trembling leaves of this tree touch my heart like the fingers
    755. of an infant child.
    756. 263
    757. This sadness of my soul is her bride's veil.
    758. It waits to be lifted in the night.
    759. 264
    760. The little flower lies in the dust.
    761. It sought the path of the butterfly.
    762. 265
    763. I am in the world of the roads. The night comes. Open thy gate,
    764. thou world of the home.
    765. 266
    766. I have sung the songs of thy day. In the evening let me carry
    767. thy lamp through the stormy path.
    768. 267
    769. I do not ask thee into the house.
    770. Come into my infinite loneliness, my Lover.
    771. 268
    772. Death belongs to life as birth does. The walk is in the raising
    773. of the foot as in the laying of it down.
    774. 269
    775. I have learnt the simple meaning of thy whispers in flowers and
    776. sunshine--teach me to know thy words in pain and death.
    777. 270
    778. The night's flower was late when the morning kissed her, she
    779. shivered and sighed and dropped to the ground.
    780. 271
    781. Through the sadness of all things I hear the crooning of the
    782. Eternal Mother.
    783. 272
    784. I came to your shore as a stranger, I lived in your house as a
    785. guest, I leave your door as a friend, my earth.
    786. 273
    787. Let my thoughts come to you, when I am gone, like the afterglow
    788. of sunset at the margin of starry silence.
    789. 274
    790. Light in my heart the evening star of rest and then let the night
    791. whisper to me of love.
    792. 275
    793. I am a child in the dark.
    794. I stretch my hands through the coverlet of night for thee,
    795. Mother.
    796. 276
    797. The day of work is done. Hide my face in your arms, Mother.
    798. Let me dream.
    799. 277
    800. The lamp of meeting burns long; it goes out in a moment at the
    801. parting.
    802. 278
    803. One word keep for me in thy silence, O World, when I am dead, "I
    804. have loved."
    805. 279
    806. We live in this world when we love it.
    807. 280
    808. Let the dead have the immortality of fame, but the living the
    809. immortality of love.
    810. 281
    811. I have seen thee as the half-awakened child sees his mother in
    812. the dusk of the dawn and then smiles and sleeps again.
    813. 282
    814. I shall die again and again to know that life is inexhaustible.
    815. 283
    816. While I was passing with the crowd in the road I saw thy smile
    817. from the balcony and I sang and forgot all noise.
    818. 284
    819. Love is life in its fulness like the cup with its wine.
    820. 285
    821. They light their own lamps and sing their own words in their
    822. temples.
    823. But the birds sing thy name in thine own morning light,--for thy
    824. name is joy.
    825. 286
    826. Lead me in the centre of thy silence to fill my heart with songs.
    827. 287
    828. Let them live who choose in their own hissing world of fireworks.
    829. My heart longs for thy stars, my God.
    830. 288
    831. Love's pain sang round my life like the unplumbed sea, and love's
    832. joy sang like birds in its flowering groves.
    833. 289
    834. Put out the lamp when thou wishest.
    835. I shall know thy darkness and shall love it.
    836. 290
    837. When I stand before thee at the day's end thou shalt see my scars
    838. and know that I had my wounds and also my healing.
    839. 291
    840. Some day I shall sing to thee in the sunrise of some other world,
    841. "I have seen thee before in the light of the earth, in the love
    842. of man."
    843. 292
    844. Clouds come floating into my life from other days no longer to
    845. shed rain or usher storm but to give colour to my sunset sky.
    846. 293
    847. Truth raises against itself the storm that scatters its seeds
    848. broadcast.
    849. 294
    850. The storm of the last night has crowned this morning with golden
    851. peace.
    852. 295
    853. Truth seems to come with its final word; and the final word gives
    854. birth to its next.
    855. 296
    856. Blessed is he whose fame does not outshine his truth.
    857. 297
    858. Sweetness of thy name fills my heart when I forget mine--like thy
    859. morning sun when the mist is melted.
    860. 298
    861. The silent night has the beauty of the mother and the clamorous
    862. day of the child.
    863. 299
    864. The world loved man when he smiled. The world became afraid of
    865. him when he laughed.
    866. 300
    867. God waits for man to regain his childhood in wisdom.
    868. 301
    869. Let me feel this world as thy love taking form, then my love will
    870. help it.
    871. 302
    872. Thy sunshine smiles upon the winter days of my heart, never
    873. doubting of its spring flowers.
    874. 303
    875. God kisses the finite in his love and man the infinite.
    876. 304
    877. Thou crossest desert lands of barren years to reach the moment of
    878. fulfilment.
    879. 305
    880. God's silence ripens man's thoughts into speech.
    881. 306
    882. Thou wilt find, Eternal Traveller, marks of thy footsteps across
    883. my songs.
    884. 307
    885. Let me not shame thee, Father, who displayest thy glory in thy
    886. children.
    887. 308
    888. Cheerless is the day, the light under frowning clouds is like a
    889. punished child with traces of tears on its pale cheeks, and the
    890. cry of the wind is like the cry of a wounded world. But I know I
    891. am travelling to meet my Friend.
    892. 309
    893. To-night there is a stir among the palm leaves, a swell in the
    894. sea, Full Moon, like the heart throb of the world. From what
    895. unknown sky hast thou carried in thy silence the aching secret of
    896. love?
    897. 310
    898. I dream of a star, an island of light, where I shall be born and
    899. in the depth of its quickening leisure my life will ripen its
    900. works like the ricefield in the autumn sun.
    901. 311
    902. The smell of the wet earth in the rain rises like a great chant
    903. of praise from the voiceless multitude of the insignificant.
    904. 312
    905. That love can ever lose is a fact that we cannot accept as truth.
    906. 313
    907. We shall know some day that death can never rob us of that which
    908. our soul has gained, for her gains are one with herself.
    909. 314
    910. God comes to me in the dusk of my evening with the flowers from
    911. my past kept fresh in his basket.
    912. 315
    913. When all the strings of my life will be tuned, my Master, then at
    914. every touch of thine will come out the music of love.
    915. 316
    916. Let me live truly, my Lord, so that death to me become true.
    917. 317
    918. Man's history is waiting in patience for the triumph of the
    919. insulted man.
    920. 318
    921. I feel thy gaze upon my heart this moment like the sunny silence
    922. of the morning upon the lonely field whose harvest is over.
    923. 319
    924. I long for the Island of Songs across this heaving Sea of Shouts.
    925. 320
    926. The prelude of the night is commenced in the music of the sunset,
    927. in its solemn hymn to the ineffable dark.
    928. 321
    929. I have scaled the peak and found no shelter in fame's bleak and
    930. barren height. Lead me, my Guide, before the light fades, into
    931. the valley of quiet where life's harvest mellows into golden
    932. wisdom.
    933. 322
    934. Things look phantastic in this dimness of the dusk--the spires
    935. whose bases are lost in the dark and tree tops like blots of ink.
    936. I shall wait for the morning and wake up to see thy city in the
    937. light.
    938. 323
    939. I have suffered and despaired and known death and I am glad that
    940. I am in this great world.
    941. 324
    942. There are tracts in my life that are bare and silent. They are
    943. the open spaces where my busy days had their light and air.
    944. 325
    945. Release me from my unfulfilled past clinging to me from behind
    946. making death difficult.
    947. 326
    948. Let this be my last word, that I trust in thy love.

    二、代码

    1. import numpy as np
    2. import re
    3. import tensorflow as tf
    4. from tensorflow.keras.models import Sequential
    5. from tensorflow.keras.layers import Embedding, LSTM, Dense
    6. from tensorflow.keras.preprocessing.text import Tokenizer
    7. from tensorflow.keras.preprocessing.sequence import pad_sequences
    8. def preprocess_text(file_path):
    9. # 读取文件内容
    10. with open(file_path, 'r', encoding='utf-8') as file:
    11. text = file.read()
    12. # 转换为小写并去除标点符号
    13. text = text.lower()
    14. text = re.sub(r'[^a-z\s]', '', text)
    15. return text
    16. def create_sequences(text, tokenizer, max_sequence_len):
    17. sequences = []
    18. words = text.split()
    19. for i in range(max_sequence_len, len(words)):
    20. seq = words[i - max_sequence_len:i + 1]
    21. token_list = tokenizer.texts_to_sequences([seq])[0]
    22. sequences.append(token_list)
    23. return sequences
    24. def generate_text(model, tokenizer, start_words, max_sequence_len, num_words):
    25. input_text = start_words
    26. for _ in range(num_words):
    27. token_list = tokenizer.texts_to_sequences([input_text.split()])[0]
    28. token_list = pad_sequences([token_list], maxlen=max_sequence_len, padding='pre')
    29. predicted = model.predict(token_list, verbose=0)
    30. predicted_word_index = np.argmax(predicted, axis=1)[0]
    31. output_word = tokenizer.index_word[predicted_word_index]
    32. input_text += ' ' + output_word
    33. return input_text
    34. # 主函数
    35. def main():
    36. file_path = 'E:\\自然语言处理\\feiniao.txt'
    37. start_words = "The meaning of life is"
    38. num_words = 50
    39. max_sequence_len = 10
    40. # 预处理文本
    41. text = preprocess_text(file_path)
    42. # 创建词汇表
    43. tokenizer = Tokenizer()
    44. tokenizer.fit_on_texts([text])
    45. total_words = len(tokenizer.word_index) + 1
    46. # 创建训练数据
    47. sequences = create_sequences(text, tokenizer, max_sequence_len)
    48. sequences = np.array(pad_sequences(sequences, maxlen=max_sequence_len + 1, padding='pre'))
    49. X, y = sequences[:, :-1], sequences[:, -1]
    50. y = tf.keras.utils.to_categorical(y, num_classes=total_words)
    51. # 构建和训练RNN模型
    52. model = Sequential()
    53. model.add(Embedding(input_dim=total_words, output_dim=50, input_length=max_sequence_len))
    54. model.add(LSTM(100, return_sequences=False))
    55. model.add(Dense(total_words, activation='softmax'))
    56. model.compile(loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])
    57. model.fit(X, y, epochs=100, verbose=2)
    58. # 生成文本
    59. generated_text = generate_text(model, tokenizer, start_words, max_sequence_len, num_words)
    60. print(generated_text)
    61. if __name__ == '__main__':
    62. main()

    三、续写结果

    The meaning of life is dropped to its fulness in the sunlight the tree the scabbard comes in the morning bees where has my heart the music of the coin with its parody makes the storms but he who loves is a perpetual that that finds their own music will the fruit god up in

    总而言之感觉续写出来还是不错的,当然还可以用2-gram模型来做

    四、n-gram语言模型

    1. import re
    2. import random
    3. from collections import defaultdict
    4. %matplotlib inline
    5. def preprocess_text(file_path):
    6. # 读取文件内容
    7. with open(file_path, 'r', encoding='utf-8') as file:
    8. text = file.read()
    9. # 转换为小写并去除标点符号
    10. text = text.lower()
    11. text = re.sub(r'[^a-z\s]', '', text)
    12. words = text.split()
    13. return words
    14. def build_2gram_model(words):
    15. # 创建一个默认字典,其中值为另一个默认字典(用于存储词对及其频率)
    16. model = defaultdict(lambda: defaultdict(int))
    17. # 统计每个词对的频率
    18. for i in range(len(words) - 1):
    19. model[words[i]][words[i + 1]] += 1
    20. return model
    21. def generate_text(model, start_words, num_words):
    22. # 拆分起始词
    23. current_word = start_words.split()[-1]
    24. generated_words = start_words.split()
    25. for _ in range(num_words):
    26. if current_word not in model:
    27. break
    28. next_word_candidates = model[current_word]
    29. next_word = random.choices(list(next_word_candidates.keys()), weights=next_word_candidates.values())[0]
    30. generated_words.append(next_word)
    31. current_word = next_word
    32. return ' '.join(generated_words)
    33. # 主函数
    34. def main():
    35. file_path = 'E:\\自然语言处理\\feiniao.txt'
    36. start_words = "The meaning of life is"
    37. num_words = 60
    38. # 预处理文本
    39. words = preprocess_text(file_path)
    40. # 构建2-gram模型
    41. model = build_2gram_model(words)
    42. # 生成文本
    43. generated_text = generate_text(model, start_words, num_words)
    44. print(generated_text)
    45. if __name__ == '__main__':
    46. main()

    2-gram续写结果为:

    The meaning of life is this little of life making the night for the fading day of your love of the eternal mother the earth his morning light that the nest of the flaming fire warns me praise from the morning upon the earth let my sadness of heart never rob us the evening veiled with splendour the water the sleeping birds wings with the

    当然每次运行结果可能都是不同的,看大家选择吧。

  • 相关阅读:
    基于python的家政管理系统毕业设计源码071111
    2022-27-27——SpringBoot2.0集成WebSocket,实现后台向前端推送信息
    视频需求超平常数 10 倍,却节省 60% 的 IT 成本投入是种什么样体验?
    透视俄乌网络战之二:Conti勒索软件集团(上)
    2022re:Invent:亚马逊云科技拥有强大的云原生数据能力
    计算机毕业设计:基于HTML学校后台用户登录界面模板源码
    c# 国内外ORM 框架 dapper efcore sqlsugar freesql hisql sqlserver数据常规插入测试性能对比
    MFC 皮肤库配置
    【JVM技术专题】 深入学习JIT编译器实现机制「 原理篇」
    【PyQt小知识 - 4】:QGroupBox分组框控件 - 边框和标题设置
  • 原文地址:https://blog.csdn.net/m0_67587248/article/details/139297929