Live data from Hacker News

Show HN: Analyzing top HN posts with language models

news.ycombinator.com

1–10 of 44 posts

Show HN: Analyzing top HN posts with language models

#1
Hi HN,

I spent a few weeks looking at the top HN posts of all time. This included exploration, clustering, creating visualizations, and zooming in on what (to me personally) seems like some of the best discussions on here.

Three things in this post:

1- The interesting groups of HN posts

2- The interactive visualizations that you can explore in your browser

3- The data from this exploration -- this includes CSV of the titles as well as the text embeddings of 3,000 Ask HN articles.

Blog post about this whole process here: [1]

============

1- The interesting groups of HN posts

From the exploration, Ask HN proved the most interesting. These are the top four groups of topics I found insightful. Each group contains about 400 posts.

- Life experiences and advice threads [2]

- Technical and personal development [3]

- Software career insights, advice, and discussions [4]

- General content recommendations (blogs/podcasts) [5]

============

2- The interactive visualizations that you can explore in your browser

- Top 10,000 Hacker News articles of all time [6]

- Top 3,000 posts in Ask HN [7]

============

3- The data from this exploration

CSV file of top 3K Ask HN posts: [8]

The sentence embeddings of the titles of those posts: [9]

This is a colab notebook containing the code examples (including loading these two data files): [10]

============

If you've ever wanted to get into language models, this is a good place to start. Happy to answer any questions

Re: Show HN: Analyzing top HN posts with language models

#2
[1] https://txt.cohere.ai/combing-for-insight-in-10-000-hacker-n...

[2] https://assets.cohere.ai/blog/text-clustering/askhn_cluster_...

[3] https://assets.cohere.ai/blog/text-clustering/askhn_cluster_...

[4] https://assets.cohere.ai/blog/text-clustering/askhn_cluster_...

[5] https://assets.cohere.ai/blog/text-clustering/askhn_cluster_...

[6] https://assets.cohere.ai/blog/text-clustering/hn10k_clustere...

[7] https://assets.cohere.ai/blog/text-clustering/askhn-3k.html

[8] https://storage.googleapis.com/cohere-assets/blog/text-clust...

[9] https://storage.googleapis.com/cohere-assets/blog/text-clust...

[10] https://colab.research.google.com/github/cohere-ai/notebooks...

Re: Show HN: Analyzing top HN posts with language models

#3
I don't know how HN score metrics work but after some short review of the datafile [1] I've noticed a lot of the posts has the form of a simple questions and as such seems to be naturally biased when comes to user engagement. Have you considered to add additional metrics to remove that bias and re-analyze?

[1] https://storage.googleapis.com/cohere-assets/blog/text-clust...

Re: Show HN: Analyzing top HN posts with language models

#5

Interesting, but it doesn't seem like the dimensionality reduction produces a good separation of topics. The UMAP projection looks pretty dense. Did you consider pruning or using something other than embeddings?

So it really depends on what you use for clustering. In this case, I'm clustering by the original embeddings so the UMAP results are different. I've also seen:

1- Clustering by UMAP. Here the plot would show clean separation of topics. But the clustering algorithm would be working on highly compressed data (from the 1024 dimensions of the embedding down to the 2 of UMAP).

2- BERTopic's approach of doing UMAP down to 5 dimensions, using this dimensionality for clustering, then UMAP again from 5 to 2. Which is an interesting approach.

I've heard people having good results with all three. It's kinda hard to objectively compare, but my leaning was to give the clustering algorithm the representation containing the most information about the text.

Re: Show HN: Analyzing top HN posts with language models

#6
post #3

I don't know how HN score metrics work but after some short review of the datafile [1] I've noticed a lot of the posts has the form of a simple questions and as such seems to be naturally biased when comes to user engagement. Have you considered to add additional metrics to remove that bias and re-analyze? [1] https://storage.googleapis.com/cohere-assets/blog/text-clust...

What do you mean by naturally biased? That people seem to favor them?

Re: Show HN: Analyzing top HN posts with language models

#7

Interesting, but it doesn't seem like the dimensionality reduction produces a good separation of topics. The UMAP projection looks pretty dense. Did you consider pruning or using something other than embeddings?

So it really depends on what you use for clustering. In this case, I'm clustering by the original embeddings so the UMAP results are different. I've also seen: 1- Clustering by UMAP. Here the plot would show clean separation of topics. But the clustering algorithm would be working on highly compressed data (from the 1024 dimensions of the embedding down to the 2 of UMAP). 2- BERTopic's approach of doing UMAP down to…

Right, bertopic's double clustering is interesting. I've also seen people combine that with louvain instead of k-means.

My intuition was: UMAP itself tries to optimize for 2d separation in the projection. So we should expect at least some correspondence between the kmeans results and the layout in the UMAP plot (except in some pathological edge cases perhaps).

Nevertheless, nice example and blog post!

Re: Show HN: Analyzing top HN posts with language models

#8

Interesting, but it doesn't seem like the dimensionality reduction produces a good separation of topics. The UMAP projection looks pretty dense. Did you consider pruning or using something other than embeddings?

So it really depends on what you use for clustering. In this case, I'm clustering by the original embeddings so the UMAP results are different. I've also seen: 1- Clustering by UMAP. Here the plot would show clean separation of topics. But the clustering algorithm would be working on highly compressed data (from the 1024 dimensions of the embedding down to the 2 of UMAP). 2- BERTopic's approach of doing UMAP down to…

Try t-SNE. I used to scoff at cluster plots until I saw those but with t-SNE… wow, those clusters are actually separated!

Re: Show HN: Analyzing top HN posts with language models

#9

Earlier quoted context omitted.

So it really depends on what you use for clustering. In this case, I'm clustering by the original embeddings so the UMAP results are different. I've also seen: 1- Clustering by UMAP. Here the plot would show clean separation of topics. But the clustering algorithm would be working on highly compressed data (from the 1024 dimensions of the embedding down to the 2 of UMAP). 2- BERTopic's approach of doing UMAP down to…

Try t-SNE. I used to scoff at cluster plots until I saw those but with t-SNE… wow, those clusters are actually separated!

Are you sure t-SNE and UMAP actually perform very differently? Last I looked, they were somewhat comparable.

[edit]: Seems they are similar for some purposes: https://blog.bioturing.com/2022/01/14/umap-vs-t-sne-single-c...

Also interesting: Rapidsai has a cuda accelerated version of umap that is very fast (hdbscan as well BTW).

Re: Show HN: Analyzing top HN posts with language models

#10
as people upvote other things than your list of relevant links it becomes difficult to find the relevant links. although I guess people can find it by your name.

on edit: so it seems some are upvoting the links to keep them on the top in opposition to those upvoting discussion points.

Post reply on HN