{"version":"1.0","type":"rich","title":"A map-reduce class in Python, with the typical \"hello, world!\" word-counting example. You can download ulysses.txt file used in the example here: http://www.gutenberg.org/ebooks/4300","description":"This example demonstrates a word-frequency analysis of James Joyce’s *Ulysses*, showing the 100 most common words and their counts. It uses a custom `MapReducer` class, built with Python’s `abc` module for abstract methods, to implement the map-reduce pattern. The `WordReducer` subclass defines a `map` method that tokenizes lines and tallies lowercase word occurrences, while `reduce` sums the counts. The `mapreduce` method groups mapped key-value pairs via `collections.defaultdict`. The final sorted output is printed with `pprint` from the text file downloaded from Project Gutenberg.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-7583321?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}