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

Researchers gave alligators headphones and ketamine, and all for a good cause

Researchers in Germany and the United States recently gave ketamine and earphones to alligators to monitor how they process sounds. Here's what it reveals about alligator evolution.
Mobile

Flex your thumbs (and your brain) with these fun texting games

Gaming consoles keep getting more advanced, but you can still have fun with the good old Latin alphabet. Here are our picks for the best texting games, so you can make the most fun out of that limited data plan or basic cell phone.
Gaming

The best of the last generation: Our 50 favorite Xbox 360 games

The Xbox 360 thrived during a generation where games were plentiful. Here's our list of the best Xbox 360 games of all time, including all game genres and even a few special indie hits.
Home Theater

The best Dolby Atmos movies for your home theater sound as good as they look

If you've got your hands on some sweet Dolby Atmos gear, the next step is to find films that take advantage of it. These are our picks in several genres for the best Dolby Atmos movies currently available on Blu-ray and streaming services.
Movies & TV

'Prime'-time TV: Here are the best shows on Amazon Prime right now

There's more to Amazon Prime than free two-day shipping, including access to a number of phenomenal shows at no extra cost. To make the sifting easier, here are our favorite shows currently streaming on Amazon Prime.
Emerging Tech

Cheese tastes different when it listens to Led Zeppelin, Swiss study finds

A funky new study says that exposing cheese to music changes its aroma and flavor. What’s more, the genre of music matters. Researchers from the Bern University of Arts played music to nine, 22-pound wheels of Emmental cheese.
Emerging Tech

Twitter is officially a teenager now. Are we raising a monster?

On March 21, 2006, Jack Dorsey sent the first ever tweet. Thirteen years later, Twitter has fundamentally changed the way we communicate. Here are some of the myriad ways it's done that.
Emerging Tech

Astronomers plan to beam Earth’s greatest hits into deep space, and you can help

A new project from the SETI Institute (search for extraterrestrial intelligence) will give the public the chance to submit compositions to be beamed into space, with the aim of connecting people around the world through music.
Emerging Tech

Scientists have a way to turn off alcoholism: Blasting the brain with lasers

Researchers from Scripps Research have demonstrated that it is possible to reverse the desire to drink in alcohol-dependent rats by targeting a part of the brain using lasers. Here's how.
Emerging Tech

China has cloned its best police dog. Now it wants to mass-produce more

Scientists in China have cloned the Sherlock Holmes of police sniffer dogs, with possible plans to mass produce it in the future. Here's why its creators think that's a great idea.
Emerging Tech

Scientists use drone to map Icelandic cave in preparation for Mars exploration

Researchers from the SETI Institute and Astrobotic Technology have demonstrated a way that astronauts may be able to map Martian caves using a Lidar-equipped drone that can travel autonomously without GPS.
Emerging Tech

A 3D printer the size of a small barn will produce entire homes in Saudi Arabia

If you’re looking for a 3D printer that can comfortably fit on the side of your desk… well, Danish company Cobod International’s enormous new 3D house printer probably isn’t for you.
Deals

Need a ride? Amazon is slashing prices on popular electric scooters

If you’re not much of a cyclist or if you’re looking for a lazier way to zip about town, an electric scooter should be right up your alley. Two of our favorites, the foldable Glion Dolly and the eco-friendly Razor scooter, are on sale…
Emerging Tech

Unexpected particle plumes discovered jetting out of asteroid Bennu

The OSIRIS-REx craft traveled to asteroid Bennu last year and won't return until 2023. But the mission is already throwing up unexpected findings, like plumes of particles which are being ejected from the surface of the asteroid.