Skip to main content
  1. Home
  2. Emerging Tech
  3. Computing
  4. Mobile
  5. Web
  6. News

Digital Trends may earn a commission when you buy through links on our site. Why trust us?

With a little technological magic, this dad build a sorting hat straight out of Harry Potter

Add as a preferred source on Google

Machine learning represents a paradigm shift in programming, there’s no doubt. The concept has begun to weave its promising tendrils through everything from Facebook’s image software to Gmail’s spam filter, but a crafty engineer thought up a better use: a real-life sorting hat inspired by the character in J.K. Rowlings‘s beloved Harry Potter series.

The impetus for project lead Ryan Anderson, a tech hobbyist by night and a solutions architect for IBM by day, was a creation that would entertainingly instill in a young audience the importance of math, technology, and science. “I was thinking of fun projects and, coincidentally, I have a couple of daughters, and they are mad keen on ‘Harry Potter,'” he told Tech Insider. “They’ve read the books, like, five times.”

Recommended Videos

The first step was creating software capable of comprehending everyday speech. The storied sorting hat, described in “Harry Potter” as soothsaying headwear with the power to discern its wearers’ true nature, can speak and understand spoken phrases. In order to replicate that fantasy as faithfully as possible, Anderson tapped IBM’s Watson platform — specifically, its Natural Language Classifier and Speech to Text tools — to interpret the verbalization of wearers. The result? A system that can approximate a person’s character — “honesty,” for example, or “trustworthiness” — by the information they choose to volunteer.

Watson’s Natural Language Classifier is arguably the heart of Anderson’s sorting hat. The tool, which interprets the intent behind text and triggers a corresponding action, helps in sorting wearers into one of mystical school Hogwarts’ four distinct houses. The process begins with “ground truths,” or rows of descriptive words that a wearer might use in the course of conversation. Anderson and his daughters painstakingly categorized hundreds of descriptive adjectives — e.g., “courageous,” “brave,” and “witty” — by Hogwarts house. They’re Gryffindor, which emphasizes the traits of “daring, nerve, and chivalry”; Slytherin, which houses the “cunning” and “ambitious”; Hufflepuff, which seeks the “just” and “loyal”; and Ravenclaw, which comprises the “wise” and “clever.” (The final list contains more than 150 entries, Anderson said.)

Next up was giving the real-life sorting hat the gift of gab. That’s where Watson’s Speech to Text feature, which uses machine intelligence to decode the grammar and sentence structure of spoken phrases, worked its magic: the hat identifies words that match the “ground truths” table and returns the corresponding house. Better yet, it’s able to improve its responses over time by scouring the web, and has a built-in mechanism for accepting corrections in the (reportedly) rare instances when a wearer is sorted incorrectly.

As a test of the software’s sorting muscle, Anderson fed the hat the characteristics of famous people like Stephen Hawking, Hillary Clinton, and Donald Trump. The results? It sorted Hawking and Clinton into Ravenclaw “for their wits,” and Trump to Gryffindor for his “boldness.” Take those results as you will.

The sorting hats’s digital backbone is impressive enough, but Anderson went a step further. At a recent hackathon, he and a team of hardware engineers built a fully articulated animatronic “body,” of sorts, for the magical headpiece. Actuators furrow the hat’s brow if a wearer is sorted to Slytherin, and LED “eyes” glow bright green when someone’s labeled a Gryffindor.

Anderson’s daughters are enjoying the hat thoroughly, reportedly, but he’s not keeping the magic to himself: he’s documented the project thoroughly on GitHub. And soon, Anderson’s adding color to the hat’s responses. “I may, time permitting, for next Halloween give it more personality and make it more dynamic,” he told Tech Insider.

Kyle Wiggers
Kyle Wiggers is a writer, Web designer, and podcaster with an acute interest in all things tech. When not reviewing gadgets…
Starlink V5 is here, and it’s lighter, smarter, and far more efficient
The next-generation satellite internet kit promises improved efficiency while maintaining high-speed connectivity.
Starlink V4 vs V5

Not every hardware upgrade needs to be about speed. With Starlink V5, SpaceX is betting that a lighter design and lower power consumption matter just as much. The company has officially introduced its next-generation Starlink V5 kit, featuring a smaller and lighter design with significantly improved power efficiency.

Smaller, lighter, and far more efficient

Read more
Frontier joins the Starlink club with high-speed in-flight internet
The carrier plans to roll out SpaceX's satellite-powered Wi-Fi across its fleet starting in 2027.
Frontier Starlink partnership featured

If there's one thing budget airlines aren't exactly known for, it's great onboard Wi-Fi. In Frontier Airlines' case, it hasn't offered in-flight internet at all. That's about to change. Frontier Airlines has announced a partnership with SpaceX's Starlink to bring high-speed, low-latency internet across its fleet. Installations will begin in early 2027, making Frontier the first ultra-low-cost carrier in the United States to adopt Starlink's satellite-powered connectivity.

Streaming, browsing, and even gaming at 35,000 feet

Read more
OpenAI’s first hardware product sounds more like a companion than a speaker
The AI company is reportedly building a mobile home device that understands context and proactively helps users.
OpenAI press image

For months, rumors have suggested that OpenAI's first hardware product could be a wearable AI device, or perhaps even the beginning of its long-term smartphone ambitions. As it turns out, the company's first gadget may be something far simpler, yet arguably far more ambitious. It will help control smart-home appliances, play media, answer questions, respond to messages, and tap into the range of capabilities offered by OpenAI's ChatGPT, according to people familiar with the matter.

OpenAI's first AI device could end up being a speaker, following plenty of hype that the company is actually working on a wearable AI device and might even launch a smartphone down the road. According to a Bloomberg report, the speaker will serve as a human-like AI companion that will integrate directly with the smart home ecosystem.

Read more