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…
Yet another study says AI is bad for elections, and the rabbit hole gets worse
AI may be an election bomb waiting for someone to light the fuse
Voters cast their ballots on Election Day

Another election, another study has concluded that asking an AI chatbot for political guidance is a spectacularly bad idea. Research conducted during Hungary’s 2026 parliamentary election found that ChatGPT and Google Gemini offered not just inaccurate but also inconsistent and unreliable voting advice. The chatbots misclassified voter profiles, overlooked relevant parties, recommended parties absent from the ballot, and sometimes produced materially different answers when given the same information repeatedly.

AI keeps failing the voter test

Read more
Samsung’s humanoid robot ambitions are real, but factories come first
Samsung’s new robotics division has humanoids in its sights, although its immediate business is far more practical factory automation
Robot Touch Human Finger

Samsung wants a place in the humanoid race, but its new robotics push begins with machines built for factories rather than homes.

The CEO-led RX robotics division will initially focus on manufacturing robots. Samsung has separately identified humanoids as a priority, although it hasn’t announced a commercial model or explained where one fits into the division’s immediate plans.

Read more
The future of AI may depend on this one behind-the-scenes change
Running Claude on Android.

Whenever a new AI model arrives, it's easy to get caught up in the bells and whistles. We talk about how much smarter it is, how quickly it answers questions, or how realistic its images have become. But here's the thing: none of that matters much if the AI can't reliably work with the apps and services people use every day.

That's why an upcoming update to the Model Context Protocol (MCP) caught my attention. It isn't a new chatbot or a fancy AI model. In fact, most people will never even know it's happening. But it could quietly make the AI ecosystem a lot healthier. If you've never heard of MCP before, don't worry. Think of it as a shared language that lets AI assistants safely talk to apps like Gmail, Slack, calendars, databases, and countless other services. Instead of every company inventing its own way to make those connections, MCP gives everyone a common rulebook.

Read more