When a neural network or A.I. writes Harry Potter, the results are surreal and hilarious

“It’s a celebration of the failure and the enjoyment of occasionally reading something that almost sounds weirdly human” – Max Deutsch


Max Deutsch fed the first four Harry Potter books into a machine learning algorithm. He then asked it to produce a chapter based on what it learned.

The resulting new Harry Potter chapter turned our to be surreal and unintentionally hilarious.

Here are some of my favourite lines from the A.I. :

Ron didn’t even upset her little ingredients on the toilet, and a group of third-year girls last year. Highly bushy and then burst away from them quickly.

“Stinking, cowardly, scummy thing to calm too, terrible — one were covered in weird ink.”

They followed him across the hall floor, threatening praise.

Dumbledore will get out from behind a cream cake.

“I’m afraid I’ve never been paid today, I’m very sorry, if it’s deep in our Weasley”

“Pig snout,” they bowed back to the cabinet above the table. “That’s right,” said Harry offhandedly.

What happens when Dumbledore gets out from behind the cream cake? And “deep in our Weasley” sounds excruciating.

What follows is more (mostly) nonsense really.

The A.I. has a lot to learn when reproducing Fred and George’s tricks :

And Fred and George have cooked out hard to Dumbledore’s put away the different column Thursday morning, and the first Weasleys, felt them in to a dance journey down the marble staircase.

From Mad Libs to Harry Potter

On his website, Deutsch tells how he started off selling essay-writing software to his friends in the sixth grade. He thought at the time it was cutting-edge artificial intelligence, but says now “it was basically a MadLib on a CD-ROM”.

It’s no small accomplishment just getting a neural network to have proper grammar and sentences. And it got through four Harry Potter books in one night!

But we’ll stick with J.K., not A.I. Rowling for now.

You can read the entire chapter here

Leave a Reply