Abstract
Traditionally a document is visualized by a word cloud. Recently, distributed representation methods for documents have been developed, which map a document to a set of topic embeddings. Visualizing such a representation is useful to present the semantics of a document in higher granularity; it is also challenging, as there are multiple topics, each containing multiple words. We propose to visualize a set of topics using Topic Cloud, which is a pie chart consisting of topic slices, where each slice contains important words in this topic. To make important topics/words visually prominent, the sizes of topic slices and word fonts are proportional to their importance in the document. A topic cloud can help the user quickly evaluate the quality of derived document representations. For NLP practitioners, it can be used to qualitatively compare the topic quality of different document representation algorithms, or to inspect how model parameters impact the derived representations.
Introduction: The Semantic Noise of Word Clouds
Traditional word clouds (or tag clouds) are a staple of text visualization, but they suffer from a significant flaw: they are semantically "noisy." In a standard word cloud, words are typically sized by frequency and scattered randomly across the canvas. As a result, a viewer might see the word "price" next to "hospital" without understanding the underlying thematic connection between them. As documents grow in complexity, these visualizations fail to convey a coherent "big picture."
Modern Natural Language Processing (NLP) often represents documents as "topic embeddings"—mathematical vectors representing multiple themes. While these models are powerful, they are difficult to inspect. NLP practitioners need a way to see if their models are actually producing coherent topics or just a jumble of unrelated words.
The Topic Cloud Algorithm
To address these issues, the authors propose the Topic Cloud algorithm. This method evolves the traditional word cloud into a structured "pie chart" of themes, organizing a document's visualization into a circular structure based on several key principles:
- Topic Slicing: Instead of a random cluster, the document is divided into pie slices. Each slice represents a specific topic (e.g., "Healthcare," "Finance," or "Politics").
- Proportional Geometry: The angular size of each slice is proportional to that topic's importance in the document.
- Word Hierarchy: Within each slice, words are displayed with font sizes proportional to their importance within that specific topic.
- Visual Coherence: The algorithm uses distinct color palettes for different slices. Words within a slice share a base color but are slightly perturbed to remain distinct, creating a cohesive "thematic zone."
- Placement Algorithm: A geometric approach fits text within the non-rectangular bounds of a pie wedge, iteratively adjusting font sizes to ensure the most important words are placed first.
Evaluation and Key Results
The paper demonstrates the Topic Cloud using three primary text sources: pharmaceutical news regarding Turing Pharmaceuticals, a presidential campaign speech by Hillary Clinton, and academic metadata from the ICML 2016 conference.
A Diagnostic Tool for AI
The most significant application of Topic Clouds is as a "sanity check" for machine learning models. By inspecting the cloud, a researcher can immediately see if a model is "collapsing" (making all topics look the same) or if it is successfully separating distinct concepts.
For example, the authors compared a standard clustering method (K-Means) against a more advanced method (TopicVec). The Topic Cloud revealed that K-Means produced "noisy" topics where unrelated words were lumped together. In contrast, TopicVec produced much cleaner, more semantically distinct slices, as shown in the visualization of the pharmaceutical news dataset.
Hyperparameter Tuning
Using the ICML 2016 dataset, the authors demonstrated how a specific model parameter ($\gamma$) affects output. At $\gamma=3$, the Topic Cloud showed that almost all slices contained the same generic words (e.g., "optimization," "model," "data"). Increasing the parameter to $\gamma=5$ caused the cloud to "blossom" into distinct research areas like "Deep Learning," "Reinforcement Learning," and "Optimization." This qualitative "aha moment" allows for much faster model iteration than calculating complex mathematical metrics like perplexity.
Limitations and Future Work
While Topic Clouds offer a significant improvement over traditional clouds, the authors acknowledge areas for future development. Currently, word placement within slices remains somewhat random; future versions could use dimensionality reduction techniques like t-SNE to ensure that closely related words within a single slice are placed adjacent to one another. Additionally, improving the efficiency of the "word-packing" algorithm to handle the tight corners of pie slices more elegantly remains a technical challenge.
Summary updated