Computer Algorithm Generates Poetry As Good As Shakespeare’s
MIT student uses machine-learning to teach a machine how to compose sonnets.
Machine learning was recently named as the force behind a potential cure for HIV, but now it’s a process that is also capable of more artistic endeavours. MIT PhD student J. Nathan Matias used the popular machine-learning Android app Swiftkey in combination with some of Shakespeare’s famous words to produce sonnets that rival the master himself.
Swiftkey is an Android input app that uses an algorithm to predict what word you intend to type next, and can be extremely accurate once it understands your patterns and behaviours. Using the app’s standard programming, Matias used a dataset of Shakespeare’s words which was incorporated into the algorithm. He also created “Swift-speare,” which provides a touchscreen interface to write poetry.
You would be hard pressed to tell that the following sonnet was written by a machine:
When I in dreams behold thy fairest shade
Whose shade in dreams doth wake the sleeping morn
The daytime shadow of my love betray’d
Lends hideous night to dreaming’s faded form
Were painted frowns to gild mere false rebuff
Then shoulds’t my heart be patient as the sands
For nature’s smile is ornament enough
When thy gold lips unloose their drooping bands
As clouds occlude the globe’s enshrouded fears
Which can by no astron’my be assail’d
Thus, thyne appearance tears in atmospheres
No fond perceptions nor no gaze unveils
Disperse the clouds which banish light from thee
For no tears be true, until we truly see
Machine-learning still requires a human element, which means it won’t replace human poets anytime soon. But if the technology continues to advance and learn how to function independently, it could quite possibly have what it takes to join the ranks of famous poets such as Shakespeare himself.