TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

Bigram Word Cloud Animates Your Data Stories

Hands-on tutorial explaining how to create an Animated Word Cloud of bigram frequencies to display a text dataset in an MP4 video

Petr Korab
TDS Archive
Published in
5 min readMay 8, 2024

--

Source: AnimatedWordCloud library. Image by Author.

Animated word cloud displays n-gram frequencies (words and consequent words in a text corpus) over time as a sequence of images in a video file. It gives greater importance to words that appear more frequently in a source text, but it scales the dataset to work with different datasets. The original visualization method uses the intuitive logic of classic word clouds and adds a time dimension to the graph. It has been designed to explore text datasets collected over multiple periods (referred to as time-series text data”).

Michael Kane developed the core framework for animating word frequencies, and the AnimatedWordCloud (AWC) library implemented the visualization method into practice. The new release brings important updates:

  • data scaling: it now works better with text datasets of different sizes and word frequencies
  • extending the n_gram parameter ( = 2) to generate bigram word clouds
  • efficiency improvements (saving now 220 frames for each period, improved Y axis, etc.).

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Petr Korab
Petr Korab

Written by Petr Korab

Python engineer /NLP / data Viz. Text Mining Stories founder textminingstories.com

Responses (1)