Skip to main content

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

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
Former Digital Trends Contributor
Kyle Wiggers is a writer, Web designer, and podcaster with an acute interest in all things tech. When not reviewing gadgets…
Star Wars legend Ian McDiarmid gets questions about the Emperor’s sex life
Ian McDiarmid as the Emperor in Star Wars: The Rise of Skywalker.

This weekend, the Star Wars: Revenge of the Sith 20th anniversary re-release had a much stronger performance than expected with $25 million and a second-place finish behind Sinners. Revenge of the Sith was the culmination of plans by Chancellor Palpatine (Ian McDiarmid) that led to the fall of the Jedi and his own ascension to emperor. Because McDiarmid's Emperor died in his first appearance -- 1983's Return of the Jedi -- Revenge of the Sith was supposed to be his live-action swan song. However, Palpatine's return in Star Wars: Episode IX -- The Rise of Skywalker left McDiarmid being asked questions about his character's comeback, particularly about his sex life and how he could have a granddaughter.

While speaking with Variety, McDiarmid noted that fans have asked him "slightly embarrassing questions" about Palpatine including "'Does this evil monster ever have sex?'"

Read more
Waymo and Toyota explore personally owned self-driving cars
Front three quarter view of the 2023 Toyota bZ4X.

Waymo and Toyota have announced they’re exploring a strategic collaboration—and one of the most exciting possibilities on the table is bringing fully-automated driving technology to personally owned vehicles.
Alphabet-owned Waymo has made its name with its robotaxi service, the only one currently operating in the U.S. Its vehicles, including Jaguars and Hyundai Ioniq 5s, have logged tens of millions of autonomous miles on the streets of San Francisco, Los Angeles, Phoenix, and Austin.
But shifting to personally owned self-driving cars is a much more complex challenge.
While safety regulations are expected to loosen under the Trump administration, the National Highway Traffic Safety Administration (NHTSA) has so far taken a cautious approach to the deployment of fully autonomous vehicles. General Motors-backed Cruise robotaxi was forced to suspend operations in 2023 following a fatal collision.
While the partnership with Toyota is still in the early stages, Waymo says it will initially study how to merge its autonomous systems with the Japanese automaker’s consumer vehicle platforms.
In a recent call with analysts, Alphabet CEO Sundar Pichai signaled that Waymo is seriously considering expanding beyond ride-hailing fleets and into personal ownership. While nothing is confirmed, the partnership with Toyota adds credibility—and manufacturing muscle—to that vision.
Toyota brings decades of safety innovation to the table, including its widely adopted Toyota Safety Sense technology. Through its software division, Woven by Toyota, the company is also pushing into next-generation vehicle platforms. With Waymo, Toyota is now also looking at how automation can evolve beyond assisted driving and into full autonomy for individual drivers.
This move also turns up the heat on Tesla, which has long promised fully self-driving vehicles for consumers. While Tesla continues to refine its Full Self-Driving (FSD) software, it remains supervised and hasn’t yet delivered on full autonomy. CEO Elon Musk is promising to launch some of its first robotaxis in Austin in June.
When it comes to self-driving cars, Waymo and Tesla are taking very different roads. Tesla aims to deliver affordability and scale with its camera, AI-based software. Waymo, by contrast, uses a more expensive technology relying on pre-mapped roads, sensors, cameras, radar and lidar (a laser-light radar), that regulators have been quicker to trust.

Read more
Uber partners with May Mobility to bring thousands of autonomous vehicles to U.S. streets
uber may mobility av rides partnership

The self-driving race is shifting into high gear, and Uber just added more horsepower. In a new multi-year partnership, Uber and autonomous vehicle (AV) company May Mobility will begin rolling out driverless rides in Arlington, Texas by the end of 2025—with thousands more vehicles planned across the U.S. in the coming years.
Uber has already taken serious steps towards making autonomous ride-hailing a mainstream option. The company already works with Waymo, whose robotaxis are live in multiple cities, and now it’s welcoming May Mobility’s hybrid-electric Toyota Sienna vans to its platform. The vehicles will launch with safety drivers at first but are expected to go fully autonomous as deployments mature.
May Mobility isn’t new to this game. Backed by Toyota, BMW, and other major players, it’s been running AV services in geofenced areas since 2021. Its AI-powered Multi-Policy Decision Making (MPDM) tech allows it to react quickly and safely to unpredictable real-world conditions—something that’s helped it earn trust in city partnerships across the U.S. and Japan.
This expansion into ride-hailing is part of a broader industry trend. Waymo, widely seen as the current AV frontrunner, continues scaling its service in cities like Phoenix and Austin. Tesla, meanwhile, is preparing to launch its first robotaxis in Austin this June, with a small fleet of Model Ys powered by its camera-based Full Self-Driving (FSD) system. While Tesla aims for affordability and scale, Waymo and May are focused on safety-first deployments using sensor-rich systems, including lidar—a tech stack regulators have so far favored.
Beyond ride-hailing, the idea of personally owned self-driving cars is also gaining traction. Waymo and Toyota recently announced they’re exploring how to bring full autonomy to private vehicles, a move that could eventually bring robotaxi tech right into your garage.
With big names like Uber, Tesla, Waymo, and now May Mobility in the mix, the ride-hailing industry is evolving fast—and the road ahead looks increasingly driver-optional.

Read more