# Clustering Similar Stories Using LDA

DevFeed: [Clustering Similar Stories Using LDA](<https://devfeed.tech/articles/clustering-similar-stories-using-lda-31894.md>)

Original publisher: [Read original article](<http://engineering.flipboard.com//2017/02/storyclustering>)

Author: https://www.linkedin.com/in/arnab-bhadury-a6304768 (Arnab Bhadury)

Published: 2017-02-08T00:00:00Z

Content type: article

Language: en

Sources: [Flipboard](<https://devfeed.tech/sources/flipboard.md>)

Topics: [clustering](<https://devfeed.tech/topics/clustering.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [computational complexity](<https://devfeed.tech/topics/computational-complexity.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>), [monte carlo tree search](<https://devfeed.tech/topics/monte-carlo-tree-search.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [clustering](<https://devfeed.tech/tags/clustering.md>), [coverage](<https://devfeed.tech/tags/coverage.md>), [fast](<https://devfeed.tech/tags/fast.md>), [overview](<https://devfeed.tech/tags/overview.md>), [perspective](<https://devfeed.tech/tags/perspective.md>), [stories](<https://devfeed.tech/tags/stories.md>), [story](<https://devfeed.tech/tags/story.md>), [text](<https://devfeed.tech/tags/text.md>)

## AI overview

Flipboard's story roundups group articles about the same event by reducing high-dimensional text to sparse LDA topic representations, then using approximate nearest-neighbor search to cluster nearby documents. This addresses vocabulary differences and avoids choosing the number of clusters in advance; exact duplicates are removed so roundups can surface other perspectives. For scale, the post combines Alias sampling with Metropolis-Hastings proposals to speed LDA inference while accounting for changing count matrices. It reports an amortized complexity improvement and processing documents an order of magnitude faster, though the excerpt omits the runtime table and graph behind that comparison.

## Source excerpt

There is more to a story than meets the eye, and some stories deserve to be presented from more than just one perspective. With Flipboard 4.0, we have released story roundups, a new feature that adds coverage from multiple sources to a story and provides you with a fuller picture of an event. Here's how it looks: With our scale of millions of articles and constant stream of documents, it's impossible to generate these roundups manually. So, we have developed a clustering algorithm that's both fast and scalable, and in this blog post, I will explain how we create these roundups on Flipboard. Why is this difficult? Although there are many sophisticated automatic clustering algorithms, such as K-means or Agglomerative clustering, story clustering is a non-trivial problem. Because each text document can contain any word from our vocabulary, most text document representations are extremely high-dimensional. In high-dimensional spaces, even basic clustering or similarity measures fail or are very slow. Additionally, two very similar documents often have very different word usages. For example, one article may use the term kitten and another may use feline, but both articles could be referring to the same cat. Furthermore, we don't know the number of roundups that we expect to see beforehand. This makes it difficult for us to directly use parameteric algorithms such as K-means. Our clustering algorithm also needs to be fast and easy to update, because there is a constant stream of documents coming into our system. Overview Since even the most basic distance measures fail in high dimensions, the first thing we do is lower the problem's dimensionality. We represent each of our text documents as a bag-of-words, and remove stop-words and rare words from our vocabulary. Even after an aggressive trimming, the documents are still very high-dimensional. We then we use Latent Dirichlet Allocation (LDA) to further lower the documents' dimensionality. We use LDA because this algorith