7 ms·
Implementing Nearest-Neighbour Recommendations in Ruby
- alfanick 3y agoGonna leave my similar implementation of Bag-of-Words, TF/IDF and LSI (with fast nmatrix matrix multiplication), for Jekyll blog posts [0]. The code is quite self explanatory, but happy to answer questions. [0]: https://github.com/alfanick/jekyll-related-posts/blob/master/lib/jekyll-related-posts.rb https://github.com/alfanick/jekyll-related-posts/blob/master...
- simonw 3y agoI've been using language model embeddings for this kind of thing with a lot of success recently: the algorithms are effectively the same , using distances between a vector of numbers to find the most related co tent. I wrote up my related content implementation here: https://til.simonwillison.net/llms/openai-embeddings-related-content https://til.simonwillison.net/llms/openai-embeddings-related...