Movie Galaxy

About 10,000 well known films laid out as a galaxy of stars, placed by the meaning of their plots and facts, with search and recommendations.

AI and Machine Learning

Charting the galaxy...

How it works

Method

Each film is turned into a list of numbers, an embedding, from its plot summary and facts, so films with similar stories land near each other. Those embeddings are squeezed down to two dimensions for the map and grouped into clusters, which are named from their most distinctive genres and plot words. In your browser you can fly around, search, click a film for its facts and nearest neighbours, and add up to five favourites to get recommendations, each explained in plain words.

Data

Film facts from Wikidata (CC0): title, year, genres, directors, main cast, country, language and runtime. Plot summaries and one line descriptions from Wikipedia (CC BY-SA 4.0), credited. The roughly 10,000 films are the most viewed on English Wikipedia over a year, so the galaxy is full of films people know. No ratings datasets, posters or copyrighted images are used.

Model

An open text embedding model (BGE-M3) run locally turns each film's plot and facts into a 1,024 number vector. UMAP reduces those to two dimensions for the layout, and HDBSCAN finds the clusters. Recommendations are the films closest to the average of your picks, nudged by shared directors and cast, computed in your browser from a compact 64 number version of each vector.

Build

The galaxy is a WebGL star field (three.js) that draws only when the view changes. The embeddings, layout and clusters are computed once offline by a Python script in the repo; the results are small static files, loaded in parts. Nothing you do is sent anywhere.

Tech

  • Embeddings
  • UMAP
  • Clustering
  • WebGL