Show HN: My recommendation engine for Hacker News (hn-recommend.julienc.me)
I feel like this website is a gold mine. Every day, I find some very interesting stories about a topic. And sometimes, I want to find other stories covering that same topic but I can’t.
Hacker News has years of history of awesome discussion and ressources. Unfortunately, I think HN Algolia isn’t helpful in searching these old threads. As a student, I want to learn a lot from this website.
This is why I created HN Recommend. Input a sentence or the URL of an article, and get the most popular and similar posts from Hacker News.
About the technical details, I've computed the embeddings of over 100,000 articles from HN and indexed it using Faiss. I made a blog post for a deeper explanation.
Source code: https://github.com/julien040/hn-recommendation-api
Article: https://julienc.me/articles/Extract_embeddings_Hacker_News_a...
Project: https://hn-recommend.julienc.me
58 comments
[ 3.3 ms ] story [ 122 ms ] threadI may have used the incorrect term. HN Algolia is effective for searching for a particular story. However, I am unable to utilize it to find related posts on the same topic that do not contain the same words.
Maybe a tagging solution is the way? if you determine a set amount of popular keywords for a topic and filter around those, you can offer more relevant results. With some sort of public tagging system you can also have SEO friendly pages around tags and get people browsing stuff they wouldn't normally search for.
Your solution appears better suited for this use case. Thank you.
Try this: https://hn-recommend.julienc.me/?q=sf%20crime With the Newest filter vs the Oldest filter. ( btw the default Relevance filter gives only tangentially relevant results for this query. Whereas the Newest & Oldest are on point. )
This search query https://hn-recommend.julienc.me/?q=paul%20graham returns articles that are missing both words of the query
Unlike HN Algolia, it doesn't match words; it uses embeddings so stories are matched by their similar meaning rather than similar words. To find it, you might try to be more specific, such as "Paul Graham Y Combinator <facts of the article>". I'm sorry HN Recommend doesn't match your use case
If you tried it, did you have great results with? I may use it in future projects.
Overall my approach is less automated than what I have seen in your codebase so it’s likely a bigger investment. I am happy to share more.
The hit rate is low. I've only tried to get embeddings for stories with a score greater than 100. SQL Query "SELECT count(*) FROM story WHERE score > 100;" gives me 155,228 stories and the corpus size is 108,477 stories.
108,477/ 155,228 = 0,6988236658
The main problems were 404 links and posts that weren't articles (such as tweets).
I remember there was a project built on instagram which allowed a person to view instagram as it looked like to a particular celebrity.
If I recall correctly, myCANAL (the French Netflix) used to have a similar feature. You could access the recommendations of personalities of the channel, but it was curated manually.
> Resources to learn about distributed systems
I thought Murat Buffalo's blog would come up at the top. That's a gold, and I'm confident that it was shared on HN as well (maybe a year or two back).
Otherwise neat and useful!
I don't know if it would be useful or even work, but is it possible to let the user adjust the vector distance threshold and then apply the other sorting parameters to the results? Eg. if I want to go broader, but then sort by high score or something so I see popular posts within an expanded (but still relevant) cluster?
Perhaps I can compute a score for each story, where each field has a weight and rank the results using this score. For example, the score could be 0.2 x score + 0.1 x comments + 1/distance - timestamp/ 10^9. The stories with the highest rank would be shown first, and the weight (0.2, 0.1, 10^9) could be adjusted by the user, as some might prefer recency while others prefer popularity.
The content is ranked by how people discuss the topics and who discusses them
If you just do embeddings on posts you might miss relevant content. When people who have knowledge of AMD discuss intel and believe that content is relevant to AMD, the content will be ranked
The API is already made and can be found at https://github.com/julien040/hn-recommendation-api. I don't think it would be too difficult to build a Chrome extension that fetches it.
You can use the app itself to make some surprisingly powerful shortcuts, and then share them in some kind of text based serialized form (don't remember the details). I'm sure there are also ways to make them programmatically, but I doubt it would be necessary for this use case.
Seems like you basically want to extract the URL of the HN page, store it in a variable and then append that variable to the URL of your recommendation engine. There are probably more fancy variants of "extract text" that you could use, too - I'm not sure of the details.
[0] https://en.wikipedia.org/wiki/Shortcuts_(app)
For now, it only pushes the shared URL to the recommendation engine. If I have more time, I'll try to find a way to extract the URL from the HN page.
https://hackernewsletter.com
It seems search takes the two inputs as the same.
Also, search doesn't seem to work when using just 1 word.
As I can see, the longer the input, the more accurate the results. Perhaps you can try something longer, like "What is a design system for UI?"
Thanks!
https://hn-recommend.julienc.me/?q=Go
Try this https://hn-recommend.julienc.me/?q=Golang if you want stories related to Go.
Edit: add link
So I would get relevant information to me (I can skip, visit, like, dislike) whether or not it's popular. That last point is important because HN home page doesn't give you that, and most of posts could get lost in oblivion just because the first few folks did not find it interesting.
This response is very reactive heavy, where as it’s elixir I’m more interested in.
But well done on the execution. It does exactly what it states.
I’ve bookmarked.
I often search HN for additional articles and discussions based on something I’ve just read. Next time I’ll use this tool.