Show HN: Analyzing top HN posts with language models
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
43 comments
[ 4.0 ms ] story [ 96.9 ms ] thread[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...
[1] https://storage.googleapis.com/cohere-assets/blog/text-clust...
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.
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!
Thank you!
You can actually create a graph by using k-means similarities as edge weights. Then you do graph clustering on it. (using any algorithm, but louvain is one of the saner ones ... clique percolation, girvan-newman etc all have known problems).
[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).
Check out this image [1] and accompanying paper [2] for further reference
[1] https://www.semanticscholar.org/paper/A-Unifying-Perspective...
[2] https://arxiv.org/abs/2007.08902
on edit: so it seems some are upvoting the links to keep them on the top in opposition to those upvoting discussion points.
Explanation: https://ploomber.io/blog/hn_classifier/
I see a lot of articles that fall into #2 being published here without a disclaimer. And I think a disclaimer isn't necessary for #2. Even for #1 I wouldn't bother, but I understand the expectation.
Many advocate a lot against ads, targeting, etc. If we also advocate against promotional content, what would companies do to get attention and traffic?
i don't think asking people to disclose that they work for the company whose product they're promoting is "advocating against promotional content".
But I do think it may undercut the power of content marketing by introducing an unconscious and unjustified negative bias.
If a stranger shares it on HN, should I judge it in a different way? What is the true value of highlighting that the author works for the company?
Proper disclosure is a means to expose bias and external motive. It's not perfect but it's arguably the best method we have right now. There's a reason it's written into law [1]
[1]: https://www.ftc.gov/business-guidance/resources/disclosures-...
First, it's advertising in the form of paid sponsorship. Second, people have reasons to trust what a social influencer says.
I'm doing neither if I have a business or work in a business and I share here an article that I wrote that happens to promote this business.
I'm not paying a stranger to talk about the business, and you don't have any reason to trust what I say without the usual judgement you'd employ towards a stranger.
To give another example, why do we trust product reviews by strangers on Amazon? They could all be just marketers in disguise after all. But Amazon actually puts effort into removing fake reviews. Why? Because honesty matters. And when you have a bias or profit motive, it's important to disclose that part too, so people can judge your review appropriately. Paid reviewers exist, but they are usually disclosed.
Correcting myself, what I mean is adding a disclaimer may make people look at it with suspicion. Or even walk away not giving a fair chance to get to know it.
Whether I received a note from a stranger or from the company employee, it shouldn't change how I judge and evaluate it.
Yet, I think the latter introduces bias and undercuts what could be an honest marketing effort.
This is all speculative. No data-driven backing.
I am just gobsmacked that you think an "honest marketing effort" requires being less than honest about the fact that it's a marketing effort.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
But the specific "stink" I'm objecting to here is, as I said, a conflict of interest. In specific, saying, "If you've ever wanted to get into language models, this is a good place to start" purports to be neutral and helpful. When instead, this person is promoting a product. Maybe using a (to my eyes expensive) commercial service is the truly the best place to start learning that. Maybe this is truly the best service to learn it with. But we can't expect a fair answer to those questions from a person whose works at the company and whose apparent job is promoting the product that pays their salary.
- Number of top 3K per month of publishing - https://drive.google.com/file/d/1beAPP9ijruMUs5DN5wOVsBArvxP...
- Avg score of top 3K per month of publishing - https://drive.google.com/file/d/10nSIgH1a6DN6XrDU2DyMJTCgsIg...
https://en.m.wikipedia.org/wiki/Preferential_attachment