Create a wordcloud chart for the extracted text data
Modify 4 Find Word Frequencies by:
#4 Find Word Frequencies
word_str = " "
# from collections import Counter
# # Hold our word counts in a Counter Object
# transformed_word_frequency = Counter()
# # Apply filter list
# for document in tdm_client.dataset_reader(dataset_file):
# if use_filtered_list is True:
# document_id = document['id']
# # Skip documents not in our filtered_id_list
# if document_id not in filtered_id_list:
# continue
# unigrams = document.get("unigramCount", [])
# for gram, count in unigrams.items():
# clean_gram = gram.lower() # Lowercase the unigram
word_str += " " + clean_gram #Added: string of all words
# if clean_gram in stop_words: # Remove unigrams from stop words
# continue
# if not clean_gram.isalpha(): # Remove unigrams that are not alphanumeric
# continue
# transformed_word_frequency[clean_gram] += count
#Install wordcloud
pip install wordcloud
#Install matplotlib for word plot cloud
from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt