Live data from Hacker News

Show HN: I mapped HN's favorite books with GPT-4o

hnbooks.pieterma.es

1–10 of 65 posts

Show HN: I mapped HN's favorite books with GPT-4o

#1
Hey HN! I love finding new books to read on here. I wanted to gather the most mentioned books and recreate the serendipity of physical browsing. I scraped 20k comments from HN threads related to reading, extracted the references and opinions using GPT-4o mini, and visualised their embeddings as a map.

- OpenAI's embeddings were processed using UMAP and HDBSCAN. A direct 2D projection from the text embeddings didn't yield visually interesting results. Instead, HDBSCAN is first applied on a high-dimensional projection. Those clusters tend to correspond to different genres. The genre memberships are then embedded using a second round of UMAP (using Hellinger distance) which results in pleasingly dense structures.

- The books' descriptions are based on extractions from the comments and GPT's general knowledge. Quality levels vary, and it leads to some oddly specific points, but I haven't found any yet that are straight up wrong.

- There are multiple books with the same title. Currently, only the most popular one of those makes it onto the map.

- It's surprisingly hard to get high quality book cover images. I tried Google Books and a bunch of open APIs, but they all had their issues. In the end, I got the covers from GoodReads through a hacked together process that combines their autocomplete search with GPT for data linkage. Does anyone know of a reliable source?

Show HN: I mapped HN's favorite books with GPT-4o
hnbooks.pieterma.es

Re: Show HN: I mapped HN's favorite books with GPT-4o

#4
nice project, pieterma.

i'm curious about the decision to use hellinger distance for the second round of UMAP - was that purely empirical or did you have some intuition about why it'd work well for this specific dataset?

also, out of curiosity, what's the most popular book on the map that doesn't have a clear genre cluster?

Re: Show HN: I mapped HN's favorite books with GPT-4o

#5

nice project, pieterma. i'm curious about the decision to use hellinger distance for the second round of UMAP - was that purely empirical or did you have some intuition about why it'd work well for this specific dataset? also, out of curiosity, what's the most popular book on the map that doesn't have a clear genre cluster?

Thanks!

The cluster memberships that come out of the first round are distributions over the different clusters, e.g. a given book is weighted 0.8 for cluster A and 0.2 for cluster B. The Hellinger distance is well-suited to quantify the difference between two distributions like that. Cosine similarity and Euclidean distance worked as well, but Hellinger gave subjectively nicer results.

Very interesting question, I'm not sure! While developing, I noticed that the systems thinking books were spread over different genres, which I found quite pleasing. However, I'm not sure if other books were even more diffuse. I'll have to dig back in and find out :)

Re: Show HN: I mapped HN's favorite books with GPT-4o

#8
The aesthetics are nice, but what I really want is a toggleable overlay that shows the rough keyword mapping for all the books. The single book view is fine for understanding a single book, but not useful for trying to process the whole page to find one book I might want to read.

Nice project though, I love it.

Post reply on HN