Menu

Most Common Words in Reviews

Most Common Words in Reviews

One way to understand textual data is by finding the words that appear most frequently.

We'll combine all cleaned reviews into one large text and calculate the frequency of each word.

Import Counter

from collections import Counter

Count Word Frequencies

all_words = " ".join(df['clean_review'])
words = all_words.split()
word_counts = Counter(words)
common_words = word_counts.most_common(20)
common_words

Convert into a DataFrame

common_df = pd.DataFrame(common_words, columns=['Word', 'Frequency'])
common_df