A neural network tried to write a 9th Harry Potter book, with hilarious results

portkey games new harry potter label glasses
Do you remember that memorable scene in the Harry Potter books when a person seeking revenge on Ron turns out to be Dumbledore hiding behind a cream cake?

If you don’t, that’s probably because you read the version of Harry Potter written by J.K. Rowling instead of an LSTM recurrent neural network — trained to generate new Hogwarts-related stories using a data set consisting of the series’ first four books.

“I’ve been experimenting with deep learning over the past few weeks, and the Harry Potter story is the result of one of those experiments,” creator Max Deutsch told Digital Trends. “Beyond just looking for a fun way to practice what I’ve been learning, the Harry Potter project was an attempt to make something enjoyable to read.”

Since the results are more surreal mashup than anything likely to give Rowling sleepless nights, “enjoyable” may not be exactly the word. However, it’s a fascinating demonstration of what happens when a neural network turns its attention to creativity.

“The computer is quite good at capturing the rhythm and style of the source text, but the sentences themselves are mostly nonsense,” Deutsch admits. “Occasionally, there is a glimmer of sense, and these moments — plus the knowledge that a computer wrote it — is what makes the read enjoyable to me.”

Interestingly, this isn’t the first time textual analysis algorithms have been applied to the work of J.K. Rowling. When the U.K. newspaper the Sunday Times outed the mega-successful author as the scribe of detective novel The Cuckoo’s Calling a few years ago — writing under the pen name Robert Galbraith — computer scientists were called in to use machine learning to solve the mystery. By analyzing the text based on word-length distribution, usage of common words like “the” and “of,” and recurring-word pairings, they proved that she was.

Max Deutsch’s work might not have quite the academic rigor of that work, but it moves beyond it by not simply analyzing existing works — but generating new ones. “Creativity is a hard thing to explain, even in the context of humans,” he says. “If creativity is simply the act of creating something new — often based on connecting pre-existing things in new ways — then you can argue that the Harry Potter neural network was very creative. In fact, this might be the first time anyone, or anything, has constructed the sentence: ‘Dumbledore will get out from behind a cream cake.’”

You can read the rest of Deutsch’s deep learning Harry Potter story here.

Emerging Tech

Awesome Tech You Can’t Buy Yet: 1-handed drone control, a pot that stirs itself

Check out our roundup of the best new crowdfunding projects and product announcements that hit the web this week. You may not be able to buy this stuff yet, but it sure is fun to gawk!
Computing

Great PC speakers don't need to break the bank. These are our favorites

Not sure which PC speakers work best with your computer? Here are the best computer speakers on the market, whether you're working with a tight budget or looking to rattle your workstation with top-of-the-line audio components.
Mobile

These 100 best iPhone apps will turn your phone into a jack-of-all-trades

The iPhone is the most popular smartphone in the world, and we want to bring out the best in yours. Behold our comprehensive list of the best iPhone apps, from time-saving productivity tools to fun apps you won’t be able to put down.
Movies & TV

The best shows on Netflix, from 'The Haunting of Hill House’ to ‘The Good Place’

Looking for a new show to binge? Lucky for you, we've curated a list of the best shows on Netflix, whether you're a fan of outlandish anime, dramatic period pieces, or shows that leave you questioning what lies beyond.
Emerging Tech

The 20 best tech toys for kids will make you wish you were 10 again

Looking for the perfect toy or gadget for your child? Thankfully, we've rounded up some of our personal favorite tech toys, including microscopes, computer kits, and a spherical droid from a galaxy far, far away.
Emerging Tech

Astronomers discover two rogue planets that do not orbit a star

Astronomers have identified two rogue planets in our galaxy which do not orbit around a star. Unlike the vast majority of discovered planets, these rogue planets drift through space alone with no sun to shine on them.
Emerging Tech

Pairs of supermassive black holes spotted in colliding galaxies

Astronomers have discovered several pairs of supermassive black holes in galaxies that are colliding with each other. These black holes will spiral closer and closer together and eventually merge into one supermassive black hole.
Emerging Tech

Quantum-based accelerometer can locate objects without GPS

Researchers have created a quantum "compass" that allows navigation without satellites. The instrument, technically called a standalone quantum accelerometer, is small enough to be transportable and has a very high level of accuracy.
Emerging Tech

Ancient continent discovered beneath the ice of Antarctica

Antarctica could be hiding the remains of a long-lost continent. Scientists created a 3D map of the crust beneath the Antarctic ice sheet which shows a similarity to the crust in Australia and India, suggesting they used to be joined.
Emerging Tech

Rocket Lab steps into spotlight with its first commercial rocket launch

Rocket Lab has deployed multiple small satellites into orbit in its first notable commercial launch. Its New Zealand-born boss said the success means "rapid and reliable access to space is now a reality for small satellites."
Emerging Tech

Alibaba’s Singles’ Day sale smashes online shopping records

The annual online shopping frenzy that is Singles' Day this year raked in $30.8 billion, up from $25 billion last time around. The Alibaba-organized event generates more in sales than Black Friday and Cyber Monday combined.
Emerging Tech

Watch this lab-grown heart tissue beat just like the real thing

A team of researchers in Germany have used stem cells to create a lab-grown human heart tissue which actually beats, as well as responding to drugs in the same way as the real thing.
Emerging Tech

Shipping crate filled with 3D-printing robots may be the future of construction

Autodesk has created a robot-filled shipping container which may represent the future of construction work. The crate contains two robots able to 3D print custom components for building sites.
Emerging Tech

Michigan’s former transportation chief has some advice for wannabe smart cities

After 31 years as Michigan’s transportation director, Kirk Steudle has seen it all, particularly with smart city projects. He spoke with Digital Trends recently about what makes smart cities work, and offers advice along the way.