Skip to main content
100%

Word cloud comparison

✓ Published0🌍 Public
KKcnarf
Last edited Dec 3, 2018
Created on Apr 24, 2017

This example compares two word clouds of hotel reviews for Amsterdam and London, using animation to transition between them while keeping word positions stable. The layout is computed once with the d3.layout.cloud plugin, using each word’s maximum weight, then per-city font size and opacity are applied, making absent words fade out. A dropdown menu triggers the update, and the SVG text elements can be panned and zoomed via mouse, with color indicating sentiment polarity. Data comes from the Tour-Pedia API via the OpeNER sentiment pipeline.

AI-generated description

This block experiments a way to compare two word clouds dealing of the same subject area.

In this experiment, comparison emerge from animation. The chalenge is to preserve the location of each word, in order to make the animation not disruptive. To do so, the overall placement is done thanks to the d3.layout.cloud plugin (by Jason Davies), where each word's weight is the maximum possible weight. Then, word cloud specificities (here, depending on the selected city) come by applying the adequate font size and opacity (if a word is not defined for a city, it disappears).

This technique works fine, but:

  • it can lead to some overlapping (cf. around Good word),
  • it can produce some sparsed word cloud when many words disappear;

Cloud storm is another technique to compare word clouds.

This experimentation is highly inspired from Nitaku's blocks:

** original README **

This word cloud shows polarized words from reviews of accommodations. Bigger words were identified more often by sentiment analyzers. Color represents polarity (green is positive, red is negative). Use the mouse to pan and zoom.

Data is obtained from the Tour-Pedia APIs, that in turn get their input from the sentiment analysis pipeline of the OpeNER project.

The implementation makes use of d3.layout.cloud by Jason Davies.

mit Licensed

Similar vizzes