Find movies similar to another movie

To find movies whose embedding is similar to that of a specific movie, retrieve the movie and feed its embedding to the Cypher® procedure db.index.vector.queryNodes.

MATCH (m:Movie {title: 'Despicable Me'})
CALL db.index.vector.queryNodes('moviePlots', 5, m.embedding)
YIELD node, score
RETURN node.title AS title, node.plot AS plot, score
Table 1. Result with embeddings from OpenAI
title plot score

"Despicable Me"

"When a criminal mastermind uses a trio of orphan girls as pawns for a grand scheme, he finds their love is profoundly changing him for the better."

1.0

"Despicable Me 2"

"When Gru, the world’s most super-bad turned super-dad has been recruited by a team of officials to stop lethal muscle and a host of Gru’s own, He has to fight back with new gadgetry, cars, and more minion madness."

0.940204381942749

"Minions"

"Minions Stuart, Kevin and Bob are recruited by Scarlet Overkill, a super-villain who, alongside her inventor husband Herb, hatches a plot to take over the world."

0.9329936504364014

"Aladdin"

"When a street urchin vies for the love of a beautiful princess, he uses a genie’s magic power to make himself off as a prince in order to marry her."

0.9291699528694153

"Megamind"

"The supervillain Megamind finally defeats his nemesis, the superhero Metro Man. But without a hero, he loses all purpose and must find new meaning to his life."

0.9292264580726624

Table 2. Result with embeddings from SentenceTransformers
title plot score

"Despicable Me"

"When a criminal mastermind uses a trio of orphan girls as pawns for a grand scheme, he finds their love is profoundly changing him for the better."

1.0

"Love the Hard Way"

"The story of a petty thief who meets an innocent young woman and brings her into his world of crime while she teaches him the lessons of enjoying life and being loved."

0.7806928157806396

"Limits of Control, The"

"The story of a mysterious loner, a stranger in the process of completing a criminal job."

0.7746935486793518

"Half Baked"

"The story of three not so bright men who come up with a series of crazy schemes to get a friend out of jail."

0.7708940505981445

"The Man from Nowhere"

"A quiet pawnshop keeper with a violent past takes on a drug-and-organ trafficking ring in hope of saving the child who is his only friend."

0.7698113918304443

When retrieving nodes matching a search prompt, the results from OpenAI and SentenceTransformers didn’t differ much. On the other hand, in the example above they perform very differently: OpenAI is able to relate the three minion movies, whereas Despicable Me 2 and Minions don’t show up in the results from SentenceTransformers.

How come Despicable Me 2 does not show up in the top five closest movies to Despicable Me, with SentenceTransformers embeddings? Given that embeddings are generated on titles and plots, let’s look at how the plots for the two movies relate.

Despicable Me plot

When a criminal mastermind uses a trio of orphan girls as pawns for a grand scheme, he finds their love is profoundly changing him for the better.

Despicable Me 2 plot

When Gru, the world’s most super-bad turned super-dad has been recruited by a team of officials to stop lethal muscle and a host of Gru’s own, He has to fight back with new gadgetry, cars, and more minion madness.

These read like entirely different movies: what was a criminal mastermind is now Gru, the world’s most super-bad; there’s no more trio of orphan girls; there were no minions in the plot of the first movie.

Although today everybody associates Despicable Me with minions, that is not how it was described and marketed when the movie first came out. Minions stack really well in the public culture, which made them the main center of marketing afterward. The embedding model simply doesn’t have all this context — one that comes from having lived in the world for a decade, day in, day out.

OpenAI seems to be able to relate the three minion movies even if the plots alone don’t look too similar. Why OpenAI behaves in this way has entirely to do with how its model was trained. If anything though, it’s more surprising that OpenAI relates them correctly than SentenceTransformers failing at seeing a link in them.