Exploratory Data Analysis

EDA Overview

The Exploratory Data Analysis (EDA) for the Disney Princess movie dataset provides a comprehensive exploration of various aspects of these iconic films. This analysis delves into multiple perspectives, beginning with financial data, which includes examining box office performance, return on investment (ROI), and budget allocation to understand the economic impact and production trends of these movies. The EDA also explores thematic elements under the movie theme analysis, shedding light on recurring motifs, storylines, and visual styles that define the Disney Princess brand. Additionally, the analysis introduces the princess characters, focusing on their individual narratives and roles within their respective movies. This is complemented by a deeper dive into princess personality traits, using both qualitative and quantitative metrics to uncover trends and variations in how Disney has portrayed its princesses over time. Together, these sections provide a holistic view of the financial success, storytelling approaches, and character development that make Disney Princess movies culturally and economically significant.

Show Code
import wikipedia
from wordcloud import WordCloud, STOPWORDS
import matplotlib.pyplot as plt
import re
import pandas as pd
import numpy as np
import plotly.express as px
import plotly.io as pio
pio.renderers.default = "plotly_mimetype+notebook_connected"
Show Code
movie_details = pd.read_csv("../../data/raw-data/imdb_movies.csv")
princess_details = pd.read_csv("../../data/raw-data/disney_princess_data.csv")
# Drop the 'Unnamed: 0' column
movie_details = movie_details.drop(columns=['Unnamed: 0'])

movie_details.tail()
title year genres directors cast rating votes plot box_office countries languages runtimes Opening_Weekend_US Cumulative_Gross Budget ROI
9 Tangled 2010 ['Animation', 'Adventure', 'Comedy', 'Family',... ['Nathan Greno', 'Byron Howard'] ['Mandy Moore', 'Zachary Levi', 'Donna Murphy'... 7.7 509461 After receiving the healing powers from a magi... {'Budget': '$260,000,000 (estimated)', 'Openin... ['United States', 'Japan'] ['English', 'German'] ['100'] 48767052.0 5.917949e+08 260000000.0 1.276134
10 Brave 2012 ['Animation', 'Action', 'Adventure', 'Comedy',... ['Mark Andrews', 'Brenda Chapman', 'Steve Purc... ['Kelly Macdonald', 'Billy Connolly', 'Emma Th... 7.1 453754 Set in Scotland in a rugged and mythical time,... {'Budget': '$185,000,000 (estimated)', 'Openin... ['United States', 'Japan', 'United Kingdom'] ['English'] ['93'] 66323594.0 5.389832e+08 185000000.0 1.913423
11 Frozen 2013 ['Animation', 'Adventure', 'Comedy', 'Family',... ['Chris Buck', 'Jennifer Lee'] ['Kristen Bell', 'Idina Menzel', 'Jonathan Gro... 7.4 677194 Fearless optimist Anna teams up with rugged mo... {'Budget': '$150,000,000 (estimated)', 'Openin... ['United States'] ['English'] ['102'] 67391326.0 1.276480e+09 150000000.0 7.509869
12 Frozen II 2019 ['Animation', 'Adventure', 'Comedy', 'Drama', ... ['Chris Buck', 'Jennifer Lee'] ['Kristen Bell', 'Idina Menzel', 'Josh Gad', '... 6.8 201743 Having harnessed her ever-growing power after ... {'Budget': '$150,000,000 (estimated)', 'Cumula... ['Japan', 'United States'] ['English'] ['103'] NaN 1.450027e+09 150000000.0 8.666846
13 Moana 2016 ['Animation', 'Adventure', 'Comedy', 'Family',... ['Ron Clements', 'John Musker', 'Don Hall', 'C... ["Auli'i Cravalho", 'Dwayne Johnson', 'Rachel ... 7.6 397393 Moana Waialiki is a sea voyaging enthusiast an... {'Budget': '$150,000,000 (estimated)', 'Openin... ['United States'] ['English', 'French'] ['107'] 56631401.0 6.433311e+08 150000000.0 3.288874

Financial Data EDA

Taking inflation into account to adjust the gross cumulative box office, US opening weekend box office, and budget

Show Code
cpi_data = {
    1937: 14.1, 1950: 24.1, 1959: 29.2, 1989: 124.0,
    1991: 136.2, 1995: 152.4, 1998: 163.0, 2009: 214.5,
    2010: 218.1, 2013: 232.0, 2016: 240.0, 2019: 256.0,
    2023: 300.0  # Assume 2023 as the base year
}
Show Code
base_year = 2023
cpi_base = cpi_data[base_year]

# Add an inflation multiplier column based on the movie release year
movie_details['Inflation_Multiplier'] = movie_details['year'].apply(lambda x: cpi_base / cpi_data.get(x, cpi_base))
Show Code
# Adjust financial values for inflation
columns_to_adjust = ['Budget', 'Opening_Weekend_US', 'Cumulative_Gross']
for column in columns_to_adjust:
    movie_details[f'{column}_Adjusted'] = movie_details[column] * movie_details['Inflation_Multiplier']
    
# Calculate ROI_Adjusted
movie_details['ROI_Adjusted'] = (movie_details['Cumulative_Gross_Adjusted'] - movie_details['Budget_Adjusted']) / movie_details['Budget_Adjusted']

1. Which Disney Princess movies had the highest return on investment (ROI)?

Show Code
# Filter out rows with NaN ROI values
filtered_movies = movie_details.dropna(subset=['ROI_Adjusted'])

# Sort movies by ROI to highlight the highest ROI movie
filtered_movies = filtered_movies.sort_values(by='ROI_Adjusted', ascending=False)

# Create a bar plot with a logarithmic scale to reduce the visual impact of outliers
fig = px.bar(
    filtered_movies,
    x='title',
    y='ROI_Adjusted',
    title='Movies Ranked by ROI (Logarithmic Scale)',
    labels={'title': 'Movie Title', 'ROI_Adjusted': 'Return on Investment (ROI)'},
    hover_data=['Budget_Adjusted', 'Cumulative_Gross_Adjusted', 'Opening_Weekend_US_Adjusted']
)

# Update layout to use log scale for y-axis
fig.update_layout(yaxis_type="log")

# Highlight the highest ROI movie
fig.update_traces(marker_color=['pink' if i == 0 else 'blue' for i in range(len(filtered_movies))])

# Show the plot
fig.show()

2. Which Disney Princess Movie had the highest/ lowest budget?

Show Code
# Create a bar plot for Cumulative_Gross over time
fig = px.bar(
    filtered_movies,
    x='title',
    y='Budget_Adjusted',
    title='Budget for Disney Princess Movies Over Time',
    labels={'title': 'Movie Title', 'Budget_Adjusted': 'Budget (USD)'},
    hover_data=['year', 'Budget_Adjusted', 'Opening_Weekend_US_Adjusted']
)

# Rotate x-axis labels for better readability
fig.update_layout(xaxis={'tickangle': -45})

# Show the bar plot
fig.show()

3. Which Disney Princess Movie has the highest/ lowest cumulative gross box office?

Show Code
# Create a bar plot for Cumulative_Gross over time
fig = px.bar(
    filtered_movies,
    x='title',
    y='Cumulative_Gross_Adjusted',
    title='Cumulative Gross for Disney Princess Movies Over Time',
    labels={'title': 'Movie Title', 'Cumulative_Gross_Adjusted': 'Cumulative Gross (USD)'},
    hover_data=['year', 'Budget_Adjusted', 'Opening_Weekend_US_Adjusted']
)

# Rotate x-axis labels for better readability
fig.update_layout(xaxis={'tickangle': -45})

# Show the bar plot
fig.show()

User Review EDA

1. Which Disney Princess Movie had the highest/ lowest scores in IMDB?

Show Code
fig = px.bar(
    movie_details,
    x='title',
    y='rating',
    title='IMDB score on each Disney Princess Movie',
    labels={'title': 'Movie Title', 'rating': 'Movie Rating'}
)
fig.update_layout(
    xaxis={'tickangle': -45},
    yaxis=dict(range=[6.5, 8.5])  # Adjust the range to focus on visible differences
)
fig.show()

2. Which Disney Princess Movie had the highest/ lowest number of votes in IMDB?

Show Code
fig = px.bar(
    movie_details,
    x='title',
    y='votes',
    title='Number of Votes on each Disney Princess Movie',
    labels={'title': 'Movie Title', 'votes': 'number of votes'}
)
fig.show()

Princess Info EDA

Show Code
princess_details.head()
title princess_name country_of_origin iconic_theme_song princess_description
0 Snow White and the Seven Dwarfs Snow White Germany Someday My Prince Will Come Snow White knows that every day is an opportun...
1 Cinderella Cinderella France A Dream Is a Wish Your Heart Makes Cinderella knows that being a positive influen...
2 Sleeping Beauty Aurora France Once Upon a Dream Also known as Briar Rose, Aurora is graceful, ...
3 The Little Mermaid Ariel Denmark Part of Your World Driven by her independent spirit and curiosity...
4 Beauty and the Beast Belle France Beauty and the Beast Belle is imaginative and smart, and comfortabl...

1. What are the most common descrptions of princesses

Show Code
# Combine all descriptions into one string
text = ' '.join(princess_details['princess_description'])

# Generate word cloud
wordcloud = WordCloud(width=800, height=400, background_color='white').generate(text)

# Plot the word cloud
plt.figure(figsize=(10, 6))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')
plt.title('Word Cloud of Princess Descriptions')
plt.show()

Rotton Tomato Reviews EDA

1. Does length of the user comment have a relationship with the scores they give

Show Code
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

# Load the dataset
df = pd.read_csv("../../data/processed-data/frozen_processed_data.csv")

# Calculate the review length (in number of characters)
df['review_length'] = df['review_text'].astype(str).apply(len)

# Plot a scatterplot of review length vs. score
plt.figure(figsize=(10, 6))
sns.scatterplot(data=df, x='review_length', y='score', alpha=0.5)
plt.title('Relationship between Review Length and Score')
plt.xlabel('Review Length (number of characters)')
plt.ylabel('Score')
plt.show()

# Plot a boxplot of review length distribution for different scores
plt.figure(figsize=(12, 8))
sns.boxplot(x='score', y='review_length', data=df)
plt.title('Distribution of Review Length by Score')
plt.xlabel('Score')
plt.ylabel('Review Length (number of characters)')
plt.show()

2. Does the textual length of the movie review impact the sentiment score of the review?

Show Code
# Plot a scatterplot of review length vs. sentiment score
plt.figure(figsize=(10, 6))
sns.scatterplot(data=df, x='review_length', y='sentiment_score', alpha=0.5)
plt.title('Relationship between Review Length and Sentiment Score')
plt.xlabel('Review Length (number of characters)')
plt.ylabel('Sentiment Score')
plt.show()

# Define a function to classify sentiment categories
def classify_sentiment(score):
    if score >= 0.6:
        return 'Very Positive'
    elif score >= 0.2:
        return 'Positive'
    elif score > -0.2:
        return 'Neutral'
    elif score > -0.6:
        return 'Negative'
    else:
        return 'Very Negative'

# Apply the sentiment classification function
df['sentiment_category'] = df['sentiment_score'].apply(classify_sentiment)

# Plot a boxplot of review length distribution for different sentiment categories
plt.figure(figsize=(12, 8))
sns.boxplot(x='sentiment_category', y='review_length', data=df,
            order=['Very Negative', 'Negative', 'Neutral', 'Positive', 'Very Positive'])
plt.title('Distribution of Review Length by Sentiment Category')
plt.xlabel('Sentiment Category')
plt.ylabel('Review Length (number of characters)')
plt.show()

Show Code
import pandas as pd
from textblob import TextBlob
from collections import Counter
import matplotlib.pyplot as plt

# 1. Perform sentiment analysis on the "review_text" column
def sentiment_analysis(text):
    blob = TextBlob(text)
    return blob.sentiment.polarity  # Returns sentiment polarity (-1 to 1)

# 2. Classify sentiment into five categories
def classify_sentiment(score):
    if score >= 0.6:
        return 'Very Positive'
    elif score >= 0.2:
        return 'Positive'
    elif score > -0.2:
        return 'Neutral'
    elif score > -0.6:
        return 'Negative'
    else:
        return 'Very Negative'

# 3. Extract keywords and calculate their weights
def get_keywords(text_list, top_n=50):
    all_words = ' '.join(text_list).split()  # Combine all text and split into words
    word_counts = Counter(all_words)  # Count word frequencies
    return word_counts.most_common(top_n)  # Get the top N keywords and their weights

# List of CSV files to process
csv_files = [
    "aladdin_processed_data.csv",
    "beauty_and_the_beast_processed_data.csv",
    "brave_processed_data.csv",
    "cinderella_processed_data.csv",
    "frozen_processed_data.csv",
    "little_mermaid_processed_data.csv",
    "moana_processed_data.csv",
    "mulan_processed_data.csv",
    "pocahontas_processed_data.csv",
    "princess_and_the_frog_processed_data.csv",
    "sleeping_beauty_processed_data.csv",
    "snow_white_processed_data.csv",
    "tangled_processed_data.csv"
]

# Initialize lists to store keywords
all_keywords_list = []
positive_keywords_list = []
negative_keywords_list = []

# Process each CSV file
for file in csv_files:
    df = pd.read_csv(f"../../data/processed-data/{file}")
    
    # Filter out non-string values in the 'cleaned_review' column
    df = df[df['cleaned_review'].apply(lambda x: isinstance(x, str))]
    
    # Perform sentiment analysis
    df['sentiment_score'] = df['cleaned_review'].apply(sentiment_analysis)
    df['sentiment_category'] = df['sentiment_score'].apply(classify_sentiment)
    
    # Extract keywords
    all_keywords = get_keywords(df['cleaned_review'].tolist())
    positive_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Positive', 'Positive'])]['cleaned_review'].tolist())
    negative_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Negative', 'Negative'])]['cleaned_review'].tolist())
    
    # Store keywords and weights in lists
    all_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in all_keywords])
    positive_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in positive_keywords])
    negative_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in negative_keywords])

# Remove duplicates and sort by weight
all_keywords_list = sorted(list({v['keyword']: v for v in all_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
positive_keywords_list = sorted(list({v['keyword']: v for v in positive_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
negative_keywords_list = sorted(list({v['keyword']: v for v in negative_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)

# Find unique keywords in each category
all_keywords_set = set([kw['keyword'] for kw in all_keywords_list])
positive_keywords_set = set([kw['keyword'] for kw in positive_keywords_list])
negative_keywords_set = set([kw['keyword'] for kw in negative_keywords_list])

unique_all_keywords = all_keywords_set - (positive_keywords_set | negative_keywords_set)
unique_positive_keywords = positive_keywords_set - (all_keywords_set | negative_keywords_set)
unique_negative_keywords = negative_keywords_set - (all_keywords_set | positive_keywords_set)

# Convert to lists for easy display
unique_all_keywords_list = [kw for kw in all_keywords_list if kw['keyword'] in unique_all_keywords]
unique_positive_keywords_list = [kw for kw in positive_keywords_list if kw['keyword'] in unique_positive_keywords]
unique_negative_keywords_list = [kw for kw in negative_keywords_list if kw['keyword'] in unique_negative_keywords]

# Print the results
print("Common Keywords:", all_keywords_list)
print("Positive Keywords:", positive_keywords_list)
print("Negative Keywords:", negative_keywords_list)
print("Unique Common Keywords:", unique_all_keywords_list)
print("Unique Positive Keywords:", unique_positive_keywords_list)
print("Unique Negative Keywords:", unique_negative_keywords_list)
Common Keywords: [{'keyword': 'great', 'weight': 291}, {'keyword': 'rapunzel', 'weight': 291}, {'keyword': 'pixar', 'weight': 286}, {'keyword': 'animation', 'weight': 255}, {'keyword': 'story', 'weight': 247}, {'keyword': 'robin', 'weight': 244}, {'keyword': 'genie', 'weight': 239}, {'keyword': 'characters', 'weight': 235}, {'keyword': 'elsa', 'weight': 234}, {'keyword': 'good', 'weight': 211}, {'keyword': 'maleficent', 'weight': 207}, {'keyword': 'best', 'weight': 182}, {'keyword': 'first', 'weight': 173}, {'keyword': 'love', 'weight': 172}, {'keyword': 'anna', 'weight': 172}, {'keyword': 'songs', 'weight': 170}, {'keyword': 'new', 'weight': 169}, {'keyword': 'princess', 'weight': 169}, {'keyword': 'dwarfs', 'weight': 164}, {'keyword': 'animated', 'weight': 158}, {'keyword': 'ariel', 'weight': 155}, {'keyword': 'movies', 'weight': 153}, {'keyword': 'let', 'weight': 151}, {'keyword': 'tiana', 'weight': 147}, {'keyword': 'really', 'weight': 144}, {'keyword': 'fun', 'weight': 143}, {'keyword': 'mice', 'weight': 138}, {'keyword': 'merida', 'weight': 136}, {'keyword': 'seven', 'weight': 134}, {'keyword': 'fairies', 'weight': 131}, {'keyword': 'aurora', 'weight': 131}, {'keyword': 'classic', 'weight': 123}, {'keyword': 'funny', 'weight': 123}, {'keyword': 'eddie', 'weight': 123}, {'keyword': 'villain', 'weight': 122}, {'keyword': 'flynn', 'weight': 122}, {'keyword': 'well', 'weight': 118}, {'keyword': 'murphy', 'weight': 115}, {'keyword': 'orleans', 'weight': 112}, {'keyword': 'mushu', 'weight': 110}, {'keyword': 'hair', 'weight': 110}, {'keyword': 'maui', 'weight': 109}, {'keyword': 'see', 'weight': 107}, {'keyword': 'olaf', 'weight': 105}, {'keyword': 'mother', 'weight': 104}, {'keyword': 'also', 'weight': 101}, {'keyword': 'disneys', 'weight': 101}, {'keyword': 'character', 'weight': 101}, {'keyword': 'back', 'weight': 101}, {'keyword': 'time', 'weight': 100}, {'keyword': 'films', 'weight': 100}, {'keyword': 'much', 'weight': 97}, {'keyword': 'frozen', 'weight': 97}, {'keyword': 'family', 'weight': 95}, {'keyword': 'better', 'weight': 93}, {'keyword': 'jasmine', 'weight': 92}, {'keyword': 'watch', 'weight': 89}, {'keyword': 'bear', 'weight': 87}, {'keyword': 'hans', 'weight': 87}, {'keyword': 'man', 'weight': 87}, {'keyword': 'even', 'weight': 86}, {'keyword': 'chinese', 'weight': 85}, {'keyword': 'tale', 'weight': 83}, {'keyword': 'jafar', 'weight': 82}, {'keyword': 'queen', 'weight': 80}, {'keyword': 'favorite', 'weight': 79}, {'keyword': 'ever', 'weight': 78}, {'keyword': 'tower', 'weight': 78}, {'keyword': 'sea', 'weight': 77}, {'keyword': 'still', 'weight': 74}, {'keyword': 'john', 'weight': 74}, {'keyword': 'voodoo', 'weight': 73}, {'keyword': 'amazing', 'weight': 72}, {'keyword': 'beautiful', 'weight': 72}, {'keyword': 'way', 'weight': 72}, {'keyword': 'feature', 'weight': 71}, {'keyword': 'plot', 'weight': 70}, {'keyword': 'sister', 'weight': 70}, {'keyword': 'nice', 'weight': 70}, {'keyword': 'made', 'weight': 69}, {'keyword': 'hard', 'weight': 69}, {'keyword': 'black', 'weight': 69}, {'keyword': 'walt', 'weight': 69}, {'keyword': 'whole', 'weight': 68}, {'keyword': 'true', 'weight': 68}, {'keyword': 'powers', 'weight': 68}, {'keyword': 'loved', 'weight': 68}, {'keyword': 'de', 'weight': 67}, {'keyword': 'ursula', 'weight': 67}, {'keyword': 'three', 'weight': 66}, {'keyword': 'little', 'weight': 65}, {'keyword': 'snow', 'weight': 65}, {'keyword': 'white', 'weight': 65}, {'keyword': 'pixars', 'weight': 64}, {'keyword': 'action', 'weight': 64}, {'keyword': 'gothel', 'weight': 64}, {'keyword': 'voice', 'weight': 63}, {'keyword': 'music', 'weight': 63}, {'keyword': 'heart', 'weight': 63}, {'keyword': 'smith', 'weight': 63}, {'keyword': 'make', 'weight': 62}, {'keyword': 'think', 'weight': 62}, {'keyword': 'would', 'weight': 61}, {'keyword': 'lot', 'weight': 61}, {'keyword': 'world', 'weight': 60}, {'keyword': 'scottish', 'weight': 60}, {'keyword': 'fairy', 'weight': 60}, {'keyword': 'kids', 'weight': 60}, {'keyword': 'get', 'weight': 59}, {'keyword': 'girl', 'weight': 59}, {'keyword': 'traditional', 'weight': 59}, {'keyword': 'china', 'weight': 58}, {'keyword': 'didnt', 'weight': 58}, {'keyword': 'prince', 'weight': 57}, {'keyword': 'stepmother', 'weight': 57}, {'keyword': 'evil', 'weight': 56}, {'keyword': 'dragon', 'weight': 56}, {'keyword': 'wind', 'weight': 56}, {'keyword': 'though', 'weight': 55}, {'keyword': 'go', 'weight': 55}, {'keyword': 'people', 'weight': 54}, {'keyword': 'never', 'weight': 54}, {'keyword': 'another', 'weight': 53}, {'keyword': 'seen', 'weight': 53}, {'keyword': 'villains', 'weight': 53}, {'keyword': 'performance', 'weight': 52}, {'keyword': 'colors', 'weight': 52}, {'keyword': 'magic', 'weight': 51}, {'keyword': 'lamp', 'weight': 51}, {'keyword': 'always', 'weight': 51}, {'keyword': 'pretty', 'weight': 50}, {'keyword': 'female', 'weight': 50}, {'keyword': 'historical', 'weight': 50}, {'keyword': 'years', 'weight': 50}, {'keyword': 'part', 'weight': 49}, {'keyword': 'history', 'weight': 49}, {'keyword': 'old', 'weight': 49}, {'keyword': 'phillip', 'weight': 49}, {'keyword': 'memorable', 'weight': 47}, {'keyword': 'song', 'weight': 47}, {'keyword': 'wonderful', 'weight': 47}, {'keyword': 'doesnt', 'weight': 46}, {'keyword': 'many', 'weight': 45}, {'keyword': 'renaissance', 'weight': 44}, {'keyword': 'daughter', 'weight': 44}, {'keyword': 'witch', 'weight': 43}, {'keyword': 'come', 'weight': 43}, {'keyword': 'every', 'weight': 42}, {'keyword': 'que', 'weight': 42}, {'keyword': 'godmother', 'weight': 42}, {'keyword': 'makes', 'weight': 41}, {'keyword': 'different', 'weight': 40}, {'keyword': 'strong', 'weight': 40}, {'keyword': 'dont', 'weight': 40}, {'keyword': 'musical', 'weight': 39}, {'keyword': 'enough', 'weight': 39}, {'keyword': 'catchy', 'weight': 39}, {'keyword': 'dwarves', 'weight': 39}, {'keyword': 'native', 'weight': 35}, {'keyword': 'real', 'weight': 34}, {'keyword': 'could', 'weight': 31}, {'keyword': 'know', 'weight': 31}, {'keyword': 'isnt', 'weight': 31}, {'keyword': 'la', 'weight': 30}, {'keyword': 'lion', 'weight': 29}, {'keyword': 'king', 'weight': 28}, {'keyword': 'bad', 'weight': 27}, {'keyword': 'belle', 'weight': 23}, {'keyword': 'es', 'weight': 20}, {'keyword': 'un', 'weight': 16}, {'keyword': 'en', 'weight': 16}, {'keyword': 'el', 'weight': 12}, {'keyword': 'una', 'weight': 11}, {'keyword': 'thats', 'weight': 10}, {'keyword': 'art', 'weight': 9}, {'keyword': 'kid', 'weight': 9}, {'keyword': 'gaston', 'weight': 9}, {'keyword': 'fantastic', 'weight': 9}, {'keyword': 'su', 'weight': 9}, {'keyword': 'para', 'weight': 9}, {'keyword': 'los', 'weight': 9}, {'keyword': 'work', 'weight': 8}]
Positive Keywords: [{'keyword': 'great', 'weight': 273}, {'keyword': 'robin', 'weight': 198}, {'keyword': 'animation', 'weight': 192}, {'keyword': 'story', 'weight': 192}, {'keyword': 'characters', 'weight': 191}, {'keyword': 'rapunzel', 'weight': 189}, {'keyword': 'genie', 'weight': 183}, {'keyword': 'good', 'weight': 179}, {'keyword': 'best', 'weight': 172}, {'keyword': 'love', 'weight': 149}, {'keyword': 'pixar', 'weight': 148}, {'keyword': 'songs', 'weight': 140}, {'keyword': 'elsa', 'weight': 137}, {'keyword': 'animated', 'weight': 128}, {'keyword': 'princess', 'weight': 123}, {'keyword': 'movies', 'weight': 119}, {'keyword': 'new', 'weight': 115}, {'keyword': 'fun', 'weight': 113}, {'keyword': 'really', 'weight': 110}, {'keyword': 'first', 'weight': 110}, {'keyword': 'funny', 'weight': 99}, {'keyword': 'anna', 'weight': 99}, {'keyword': 'dwarfs', 'weight': 98}, {'keyword': 'ariel', 'weight': 97}, {'keyword': 'maleficent', 'weight': 97}, {'keyword': 'well', 'weight': 95}, {'keyword': 'classic', 'weight': 86}, {'keyword': 'go', 'weight': 86}, {'keyword': 'tiana', 'weight': 84}, {'keyword': 'films', 'weight': 82}, {'keyword': 'merida', 'weight': 81}, {'keyword': 'orleans', 'weight': 81}, {'keyword': 'time', 'weight': 79}, {'keyword': 'let', 'weight': 79}, {'keyword': 'flynn', 'weight': 79}, {'keyword': 'better', 'weight': 78}, {'keyword': 'seven', 'weight': 78}, {'keyword': 'disneys', 'weight': 77}, {'keyword': 'maui', 'weight': 77}, {'keyword': 'favorite', 'weight': 75}, {'keyword': 'see', 'weight': 75}, {'keyword': 'also', 'weight': 74}, {'keyword': 'character', 'weight': 73}, {'keyword': 'hair', 'weight': 73}, {'keyword': 'aurora', 'weight': 72}, {'keyword': 'watch', 'weight': 71}, {'keyword': 'amazing', 'weight': 69}, {'keyword': 'mushu', 'weight': 69}, {'keyword': 'mice', 'weight': 68}, {'keyword': 'eddie', 'weight': 68}, {'keyword': 'murphy', 'weight': 68}, {'keyword': 'much', 'weight': 66}, {'keyword': 'jafar', 'weight': 65}, {'keyword': 'villain', 'weight': 65}, {'keyword': 'fairies', 'weight': 65}, {'keyword': 'jasmine', 'weight': 64}, {'keyword': 'back', 'weight': 63}, {'keyword': 'even', 'weight': 62}, {'keyword': 'beautiful', 'weight': 61}, {'keyword': 'olaf', 'weight': 60}, {'keyword': 'frozen', 'weight': 60}, {'keyword': 'ever', 'weight': 59}, {'keyword': 'family', 'weight': 58}, {'keyword': 'tale', 'weight': 57}, {'keyword': 'bear', 'weight': 57}, {'keyword': 'mother', 'weight': 55}, {'keyword': 'sea', 'weight': 54}, {'keyword': 'voice', 'weight': 53}, {'keyword': 'music', 'weight': 53}, {'keyword': 'whole', 'weight': 53}, {'keyword': 'true', 'weight': 52}, {'keyword': 'nice', 'weight': 52}, {'keyword': 'feature', 'weight': 51}, {'keyword': 'still', 'weight': 50}, {'keyword': 'made', 'weight': 50}, {'keyword': 'que', 'weight': 50}, {'keyword': 'chinese', 'weight': 50}, {'keyword': 'get', 'weight': 49}, {'keyword': 'plot', 'weight': 49}, {'keyword': 'way', 'weight': 49}, {'keyword': 'seen', 'weight': 48}, {'keyword': 'walt', 'weight': 47}, {'keyword': 'ursula', 'weight': 46}, {'keyword': 'man', 'weight': 46}, {'keyword': 'world', 'weight': 45}, {'keyword': 'memorable', 'weight': 45}, {'keyword': 'action', 'weight': 45}, {'keyword': 'cute', 'weight': 45}, {'keyword': 'entertaining', 'weight': 45}, {'keyword': 'make', 'weight': 44}, {'keyword': 'kids', 'weight': 44}, {'keyword': 'loved', 'weight': 43}, {'keyword': 'fairy', 'weight': 43}, {'keyword': 'watching', 'weight': 43}, {'keyword': 'enjoyable', 'weight': 43}, {'keyword': 'lot', 'weight': 42}, {'keyword': 'return', 'weight': 42}, {'keyword': 'feel', 'weight': 42}, {'keyword': 'pixars', 'weight': 41}, {'keyword': 'john', 'weight': 41}, {'keyword': 'liked', 'weight': 40}, {'keyword': 'performance', 'weight': 39}, {'keyword': 'visuals', 'weight': 39}, {'keyword': 'dwayne', 'weight': 39}, {'keyword': 'soundtrack', 'weight': 39}, {'keyword': 'scottish', 'weight': 38}, {'keyword': 'adventure', 'weight': 38}, {'keyword': 'girl', 'weight': 38}, {'keyword': 'hilarious', 'weight': 37}, {'keyword': 'pretty', 'weight': 37}, {'keyword': 'naveen', 'weight': 37}, {'keyword': 'always', 'weight': 36}, {'keyword': 'johnson', 'weight': 36}, {'keyword': 'part', 'weight': 35}, {'keyword': 'catchy', 'weight': 35}, {'keyword': 'rock', 'weight': 35}, {'keyword': 'smith', 'weight': 35}, {'keyword': 'years', 'weight': 34}, {'keyword': 'musical', 'weight': 33}, {'keyword': 'another', 'weight': 33}, {'keyword': 'china', 'weight': 33}, {'keyword': 'especially', 'weight': 33}, {'keyword': 'villains', 'weight': 33}, {'keyword': 'lamp', 'weight': 32}, {'keyword': 'excellent', 'weight': 32}, {'keyword': 'acting', 'weight': 31}, {'keyword': 'renaissance', 'weight': 31}, {'keyword': 'come', 'weight': 31}, {'keyword': 'la', 'weight': 30}, {'keyword': 'little', 'weight': 30}, {'keyword': 'dragon', 'weight': 30}, {'keyword': 'historical', 'weight': 30}, {'keyword': 'makes', 'weight': 29}, {'keyword': 'daughter', 'weight': 29}, {'keyword': 'dont', 'weight': 29}, {'keyword': 'queen', 'weight': 29}, {'keyword': 'wonderful', 'weight': 28}, {'keyword': 'old', 'weight': 28}, {'keyword': 'though', 'weight': 28}, {'keyword': 'know', 'weight': 28}, {'keyword': 'snow', 'weight': 28}, {'keyword': 'perfect', 'weight': 28}, {'keyword': 'could', 'weight': 28}, {'keyword': 'three', 'weight': 28}, {'keyword': 'doesnt', 'weight': 27}, {'keyword': 'many', 'weight': 27}, {'keyword': 'white', 'weight': 27}, {'keyword': 'cinderella', 'weight': 27}, {'keyword': 'de', 'weight': 26}, {'keyword': 'strong', 'weight': 26}, {'keyword': 'stepmother', 'weight': 25}, {'keyword': 'wind', 'weight': 25}, {'keyword': 'would', 'weight': 24}, {'keyword': 'history', 'weight': 24}, {'keyword': 'real', 'weight': 24}, {'keyword': 'colors', 'weight': 24}, {'keyword': 'think', 'weight': 23}, {'keyword': 'prince', 'weight': 23}, {'keyword': 'greatest', 'weight': 23}, {'keyword': 'song', 'weight': 22}, {'keyword': 'life', 'weight': 22}, {'keyword': 'fate', 'weight': 22}, {'keyword': 'today', 'weight': 22}, {'keyword': 'full', 'weight': 22}, {'keyword': 'every', 'weight': 21}, {'keyword': 'magic', 'weight': 21}, {'keyword': 'length', 'weight': 21}, {'keyword': 'people', 'weight': 20}, {'keyword': 'belle', 'weight': 18}, {'keyword': 'es', 'weight': 18}, {'keyword': 'accurate', 'weight': 18}, {'keyword': 'message', 'weight': 18}, {'keyword': 'native', 'weight': 17}, {'keyword': 'en', 'weight': 16}, {'keyword': 'two', 'weight': 16}, {'keyword': 'historically', 'weight': 16}, {'keyword': 'un', 'weight': 15}, {'keyword': 'isnt', 'weight': 15}, {'keyword': 'el', 'weight': 11}, {'keyword': 'fantastic', 'weight': 9}, {'keyword': 'su', 'weight': 9}, {'keyword': 'para', 'weight': 9}, {'keyword': 'kid', 'weight': 8}, {'keyword': 'gaston', 'weight': 8}, {'keyword': 'picture', 'weight': 8}, {'keyword': 'bestia', 'weight': 8}, {'keyword': 'una', 'weight': 8}, {'keyword': 'los', 'weight': 8}, {'keyword': 'thats', 'weight': 8}, {'keyword': 'work', 'weight': 7}, {'keyword': 'art', 'weight': 7}]
Negative Keywords: [{'keyword': 'pixar', 'weight': 22}, {'keyword': 'let', 'weight': 15}, {'keyword': 'go', 'weight': 12}, {'keyword': 'maleficent', 'weight': 9}, {'keyword': 'bear', 'weight': 7}, {'keyword': 'wan', 'weight': 7}, {'keyword': 'na', 'weight': 7}, {'keyword': 'classic', 'weight': 6}, {'keyword': 'piece', 'weight': 6}, {'keyword': 'also', 'weight': 6}, {'keyword': 'say', 'weight': 5}, {'keyword': 'characters', 'weight': 5}, {'keyword': 'time', 'weight': 5}, {'keyword': 'pixars', 'weight': 5}, {'keyword': 'brother', 'weight': 5}, {'keyword': 'didnt', 'weight': 5}, {'keyword': 'olaf', 'weight': 5}, {'keyword': 'going', 'weight': 5}, {'keyword': 'e', 'weight': 5}, {'keyword': 'watch', 'weight': 4}, {'keyword': 'overall', 'weight': 4}, {'keyword': 'really', 'weight': 4}, {'keyword': 'hate', 'weight': 4}, {'keyword': 'evil', 'weight': 4}, {'keyword': 'classics', 'weight': 4}, {'keyword': 'saying', 'weight': 4}, {'keyword': 'every', 'weight': 4}, {'keyword': 'ive', 'weight': 4}, {'keyword': 'die', 'weight': 4}, {'keyword': 'man', 'weight': 4}, {'keyword': 'chicken', 'weight': 4}, {'keyword': 'colors', 'weight': 4}, {'keyword': 'wind', 'weight': 4}, {'keyword': 'che', 'weight': 4}, {'keyword': 'reason', 'weight': 4}, {'keyword': 'aurora', 'weight': 4}, {'keyword': 'robin', 'weight': 3}, {'keyword': 'done', 'weight': 3}, {'keyword': 'predictable', 'weight': 3}, {'keyword': 'hour', 'weight': 3}, {'keyword': 'story', 'weight': 3}, {'keyword': 'awful', 'weight': 3}, {'keyword': 'sense', 'weight': 3}, {'keyword': 'waste', 'weight': 3}, {'keyword': 'think', 'weight': 3}, {'keyword': 'felt', 'weight': 3}, {'keyword': 'mom', 'weight': 3}, {'keyword': 'disappointing', 'weight': 3}, {'keyword': 'princess', 'weight': 3}, {'keyword': 'merida', 'weight': 3}, {'keyword': 'humor', 'weight': 3}, {'keyword': 'films', 'weight': 3}, {'keyword': 'us', 'weight': 3}, {'keyword': 'opinion', 'weight': 3}, {'keyword': 'cars', 'weight': 3}, {'keyword': 'care', 'weight': 3}, {'keyword': 'never', 'weight': 3}, {'keyword': 'see', 'weight': 3}, {'keyword': 'sorry', 'weight': 3}, {'keyword': 'guy', 'weight': 3}, {'keyword': 'kid', 'weight': 3}, {'keyword': 'wrong', 'weight': 3}, {'keyword': 'even', 'weight': 3}, {'keyword': 'little', 'weight': 3}, {'keyword': 'animated', 'weight': 3}, {'keyword': 'villain', 'weight': 3}, {'keyword': 'seen', 'weight': 3}, {'keyword': 'need', 'weight': 3}, {'keyword': 'whole', 'weight': 3}, {'keyword': 'people', 'weight': 3}, {'keyword': 'wasnt', 'weight': 3}, {'keyword': 'shit', 'weight': 3}, {'keyword': 'renaissance', 'weight': 3}, {'keyword': 'forgettable', 'weight': 3}, {'keyword': 'isnt', 'weight': 3}, {'keyword': 'historically', 'weight': 3}, {'keyword': 'saw', 'weight': 3}, {'keyword': 'return', 'weight': 3}, {'keyword': 'watching', 'weight': 3}, {'keyword': 'experience', 'weight': 3}, {'keyword': 'prince', 'weight': 3}, {'keyword': 'find', 'weight': 3}, {'keyword': 'fairies', 'weight': 3}, {'keyword': 'shes', 'weight': 3}, {'keyword': 'woman', 'weight': 3}, {'keyword': 'standup', 'weight': 2}, {'keyword': 'adults', 'weight': 2}, {'keyword': 'kids', 'weight': 2}, {'keyword': 'anything', 'weight': 2}, {'keyword': 'bad', 'weight': 2}, {'keyword': 'animation', 'weight': 2}, {'keyword': 'boring', 'weight': 2}, {'keyword': 'beauty', 'weight': 2}, {'keyword': 'get', 'weight': 2}, {'keyword': 'worst', 'weight': 2}, {'keyword': 'ever', 'weight': 2}, {'keyword': 'minutes', 'weight': 2}, {'keyword': 'plot', 'weight': 2}, {'keyword': 'made', 'weight': 2}, {'keyword': 'doesnt', 'weight': 2}, {'keyword': 'feel', 'weight': 2}, {'keyword': 'could', 'weight': 2}, {'keyword': 'far', 'weight': 2}, {'keyword': 'worse', 'weight': 2}, {'keyword': 'good', 'weight': 2}, {'keyword': 'movies', 'weight': 2}, {'keyword': 'nothing', 'weight': 2}, {'keyword': 'though', 'weight': 2}, {'keyword': 'horrible', 'weight': 2}, {'keyword': 'least', 'weight': 2}, {'keyword': 'walt', 'weight': 2}, {'keyword': 'well', 'weight': 2}, {'keyword': 'dated', 'weight': 2}, {'keyword': 'girl', 'weight': 2}, {'keyword': 'yet', 'weight': 2}, {'keyword': 'dirty', 'weight': 2}, {'keyword': 'work', 'weight': 2}, {'keyword': 'favorite', 'weight': 2}, {'keyword': 'bored', 'weight': 2}, {'keyword': 'p', 'weight': 2}, {'keyword': 'oh', 'weight': 2}, {'keyword': 'liked', 'weight': 2}, {'keyword': 'found', 'weight': 2}, {'keyword': 'gave', 'weight': 2}, {'keyword': 'christmas', 'weight': 2}, {'keyword': 'stupid', 'weight': 2}, {'keyword': 'disneys', 'weight': 2}, {'keyword': 'song', 'weight': 2}, {'keyword': 'make', 'weight': 2}, {'keyword': 'thing', 'weight': 2}, {'keyword': 'sister', 'weight': 2}, {'keyword': 'la', 'weight': 2}, {'keyword': 'de', 'weight': 2}, {'keyword': 'always', 'weight': 2}, {'keyword': 'dancing', 'weight': 2}, {'keyword': 'unless', 'weight': 2}, {'keyword': 'rock', 'weight': 2}, {'keyword': 'funny', 'weight': 2}, {'keyword': 'tangled', 'weight': 2}, {'keyword': 'frozen', 'weight': 2}, {'keyword': 'recommend', 'weight': 2}, {'keyword': 'idea', 'weight': 2}, {'keyword': 'ill', 'weight': 2}, {'keyword': 'eddie', 'weight': 2}, {'keyword': 'murphy', 'weight': 2}, {'keyword': 'dont', 'weight': 2}, {'keyword': 'dragon', 'weight': 2}, {'keyword': 'music', 'weight': 2}, {'keyword': 'dull', 'weight': 2}, {'keyword': 'fucking', 'weight': 2}, {'keyword': 'native', 'weight': 2}, {'keyword': 'americans', 'weight': 2}, {'keyword': 'weird', 'weight': 2}, {'keyword': 'lame', 'weight': 2}, {'keyword': 'historical', 'weight': 2}, {'keyword': 'means', 'weight': 2}, {'keyword': 'bland', 'weight': 2}, {'keyword': 'effort', 'weight': 2}, {'keyword': 'della', 'weight': 2}, {'keyword': 'una', 'weight': 2}, {'keyword': 'non', 'weight': 2}, {'keyword': 'viene', 'weight': 2}, {'keyword': 'nel', 'weight': 2}, {'keyword': 'mai', 'weight': 2}, {'keyword': 'completely', 'weight': 2}, {'keyword': 'review', 'weight': 2}, {'keyword': 'especially', 'weight': 2}, {'keyword': 'lion', 'weight': 2}, {'keyword': 'king', 'weight': 2}, {'keyword': 'alright', 'weight': 2}, {'keyword': 'underrated', 'weight': 2}, {'keyword': 'beyond', 'weight': 2}, {'keyword': 'hard', 'weight': 2}, {'keyword': 'old', 'weight': 2}, {'keyword': 'standards', 'weight': 2}, {'keyword': 'went', 'weight': 2}, {'keyword': 'everything', 'weight': 2}, {'keyword': 'gets', 'weight': 2}, {'keyword': 'buy', 'weight': 2}, {'keyword': 'child', 'weight': 2}, {'keyword': 'pretty', 'weight': 2}, {'keyword': 'ok', 'weight': 2}, {'keyword': 'silly', 'weight': 2}, {'keyword': 'power', 'weight': 2}, {'keyword': 'instead', 'weight': 2}, {'keyword': 'love', 'weight': 2}, {'keyword': 'daughter', 'weight': 2}, {'keyword': 'rate', 'weight': 2}, {'keyword': 'queen', 'weight': 2}, {'keyword': 'apple', 'weight': 2}, {'keyword': 'another', 'weight': 2}, {'keyword': 'almost', 'weight': 2}, {'keyword': 'sucked', 'weight': 2}, {'keyword': 'cant', 'weight': 1}, {'keyword': 'behind', 'weight': 1}, {'keyword': 'mask', 'weight': 1}, {'keyword': 'discovered', 'weight': 1}, {'keyword': 'limitless', 'weight': 1}, {'keyword': 'stage', 'weight': 1}, {'keyword': 'comedy', 'weight': 1}, {'keyword': 'complaint', 'weight': 1}, {'keyword': 'stars', 'weight': 1}, {'keyword': 'give', 'weight': 1}, {'keyword': 'makes', 'weight': 1}, {'keyword': 'titular', 'weight': 1}, {'keyword': 'character', 'weight': 1}, {'keyword': 'suffers', 'weight': 1}, {'keyword': 'excessive', 'weight': 1}, {'keyword': 'use', 'weight': 1}, {'keyword': 'pop', 'weight': 1}, {'keyword': 'culture', 'weight': 1}, {'keyword': 'references', 'weight': 1}, {'keyword': 'songs', 'weight': 1}, {'keyword': 'quality', 'weight': 1}, {'keyword': 'beast', 'weight': 1}, {'keyword': 'job', 'weight': 1}, {'keyword': 'despite', 'weight': 1}, {'keyword': 'ending', 'weight': 1}, {'keyword': 'works', 'weight': 1}, {'keyword': 'memorable', 'weight': 1}, {'keyword': 'performance', 'weight': 1}, {'keyword': 'genii', 'weight': 1}, {'keyword': 'wasted', 'weight': 1}, {'keyword': 'opportunity', 'weight': 1}, {'keyword': 'rubbing', 'weight': 1}, {'keyword': 'jafars', 'weight': 1}, {'keyword': 'lamp', 'weight': 1}, {'keyword': 'getting', 'weight': 1}, {'keyword': 'wishes', 'weight': 1}, {'keyword': 'featuring', 'weight': 1}, {'keyword': 'cast', 'weight': 1}, {'keyword': 'paige', 'weight': 1}, {'keyword': 'ohara', 'weight': 1}, {'keyword': 'belle', 'weight': 1}, {'keyword': 'jerry', 'weight': 1}, {'keyword': 'orbach', 'weight': 1}, {'keyword': 'candelabra', 'weight': 1}, {'keyword': 'angela', 'weight': 1}, {'keyword': 'lansbury', 'weight': 1}, {'keyword': 'mrs', 'weight': 1}, {'keyword': 'potts', 'weight': 1}, {'keyword': 'terrible', 'weight': 1}, {'keyword': 'still', 'weight': 1}, {'keyword': 'annoying', 'weight': 1}, {'keyword': 'feels', 'weight': 1}, {'keyword': 'crap', 'weight': 1}, {'keyword': 'dialogue', 'weight': 1}, {'keyword': 'may', 'weight': 1}, {'keyword': 'kinda', 'weight': 1}, {'keyword': 'aged', 'weight': 1}, {'keyword': 'questionable', 'weight': 1}, {'keyword': 'decisions', 'weight': 1}, {'keyword': 'paper', 'weight': 1}, {'keyword': 'thin', 'weight': 1}, {'keyword': 'message', 'weight': 1}, {'keyword': 'cry', 'weight': 1}, {'keyword': 'fairy', 'weight': 1}, {'keyword': 'godmother', 'weight': 1}, {'keyword': 'shows', 'weight': 1}, {'keyword': 'crying', 'weight': 1}, {'keyword': 'baby', 'weight': 1}, {'keyword': 'sitting', 'weight': 1}, {'keyword': 'overrated', 'weight': 1}, {'keyword': 'hated', 'weight': 1}, {'keyword': 'way', 'weight': 1}, {'keyword': 'looped', 'weight': 1}, {'keyword': 'much', 'weight': 1}, {'keyword': 'got', 'weight': 1}, {'keyword': 'sick', 'weight': 1}, {'keyword': 'despus', 'weight': 1}, {'keyword': 'del', 'weight': 1}, {'keyword': 'rey', 'weight': 1}, {'keyword': 'len', 'weight': 1}, {'keyword': 'mejor', 'weight': 1}, {'keyword': 'pelcula', 'weight': 1}, {'keyword': 'animacin', 'weight': 1}, {'keyword': 'un', 'weight': 1}, {'keyword': 'cuento', 'weight': 1}, {'keyword': 'maravilloso', 'weight': 1}, {'keyword': 'que', 'weight': 1}, {'keyword': 'por', 'weight': 1}, {'keyword': 'desgracia', 'weight': 1}, {'keyword': 'propia', 'weight': 1}, {'keyword': 'empresa', 'weight': 1}, {'keyword': 'desprecia', 'weight': 1}, {'keyword': 'con', 'weight': 1}, {'keyword': 'su', 'weight': 1}, {'keyword': 'nueva', 'weight': 1}, {'keyword': 'versin', 'weight': 1}, {'keyword': 'weak', 'weight': 1}, {'keyword': 'sickening', 'weight': 1}, {'keyword': 'typical', 'weight': 1}, {'keyword': 'romance', 'weight': 1}, {'keyword': 'trash', 'weight': 1}, {'keyword': 'second', 'weight': 1}, {'keyword': 'goooooooooooooooooooooo', 'weight': 1}, {'keyword': 'whats', 'weight': 1}, {'keyword': 'cringe', 'weight': 1}, {'keyword': 'girly', 'weight': 1}, {'keyword': 'everyday', 'weight': 1}, {'keyword': 'water', 'weight': 1}, {'keyword': 'coke', 'weight': 1}, {'keyword': 'genuinely', 'weight': 1}, {'keyword': 'understand', 'weight': 1}, {'keyword': 'thought', 'weight': 1}, {'keyword': 'actual', 'weight': 1}, {'keyword': 'layoutsetup', 'weight': 1}, {'keyword': 'simplistic', 'weight': 1}, {'keyword': 'date', 'weight': 1}, {'keyword': 'soundtrack', 'weight': 1}, {'keyword': 'things', 'weight': 1}, {'keyword': 'based', 'weight': 1}, {'keyword': 'real', 'weight': 1}, {'keyword': 'events', 'weight': 1}, {'keyword': 'come', 'weight': 1}, {'keyword': 'protagonist', 'weight': 1}, {'keyword': 'besides', 'weight': 1}, {'keyword': 'reflection', 'weight': 1}, {'keyword': 'take', 'weight': 1}, {'keyword': 'risks', 'weight': 1}, {'keyword': 'pocahontas', 'weight': 1}, {'keyword': 'hunchback', 'weight': 1}, {'keyword': 'notre', 'weight': 1}, {'keyword': 'dame', 'weight': 1}, {'keyword': 'charm', 'weight': 1}, {'keyword': 'cookie', 'weight': 1}, {'keyword': 'years', 'weight': 1}, {'keyword': 'put', 'weight': 1}, {'keyword': 'alot', 'weight': 1}, {'keyword': 'development', 'weight': 1}, {'keyword': 'loks', 'weight': 1}, {'keyword': 'amzingly', 'weight': 1}, {'keyword': 'pure', 'weight': 1}, {'keyword': 'remain', 'weight': 1}, {'keyword': 'catchy', 'weight': 1}, {'keyword': 'detail', 'weight': 1}, {'keyword': 'backgrounds', 'weight': 1}, {'keyword': 'todaytms', 'weight': 1}, {'keyword': 'shame', 'weight': 1}, {'keyword': 'treat', 'weight': 1}, {'keyword': 'whites', 'weight': 1}, {'keyword': 'voice', 'weight': 1}, {'keyword': 'annoyed', 'weight': 1}, {'keyword': 'fact', 'weight': 1}, {'keyword': 'dumb', 'weight': 1}, {'keyword': 'enough', 'weight': 1}, {'keyword': 'eat', 'weight': 1}, {'keyword': 'given', 'weight': 1}, {'keyword': 'creepy', 'weight': 1}, {'keyword': 'villainess', 'weight': 1}, {'keyword': 'crazy', 'weight': 1}, {'keyword': 'tiny', 'weight': 1}, {'keyword': 'german', 'weight': 1}, {'keyword': 'endgame', 'weight': 1}, {'keyword': 'fuck', 'weight': 1}, {'keyword': 'theaters', 'weight': 1}, {'keyword': 'playing', 'weight': 1}, {'keyword': 'meh', 'weight': 1}, {'keyword': 'maked', 'weight': 1}, {'keyword': 'fall', 'weight': 1}, {'keyword': 'asleep', 'weight': 1}, {'keyword': 'hollow', 'weight': 1}, {'keyword': 'horrifying', 'weight': 1}, {'keyword': 'foot', 'weight': 1}, {'keyword': 'porn', 'weight': 1}, {'keyword': 'contemporary', 'weight': 1}, {'keyword': 'musicals', 'weight': 1}, {'keyword': 'changed', 'weight': 1}, {'keyword': 'game', 'weight': 1}, {'keyword': 'u', 'weight': 1}, {'keyword': 'working', 'weight': 1}, {'keyword': 'halfremembered', 'weight': 1}, {'keyword': 'family', 'weight': 1}, {'keyword': 'recipe', 'weight': 1}, {'keyword': 'tried', 'weight': 1}, {'keyword': 'whip', 'weight': 1}, {'keyword': 'together', 'weight': 1}, {'keyword': 'quintessential', 'weight': 1}, {'keyword': 'girlfriend', 'weight': 1}, {'keyword': 'churning', 'weight': 1}, {'keyword': 'cold', 'weight': 1}, {'keyword': 'comforts', 'weight': 1}, {'keyword': 'millenials', 'weight': 1}, {'keyword': 'theyd', 'weight': 1}, {'keyword': 'jealously', 'weight': 1}, {'keyword': 'raised', 'weight': 1}, {'keyword': 'aidan', 'weight': 1}, {'keyword': 'fail', 'weight': 1}, {'keyword': 'drives', 'weight': 1}]
Unique Common Keywords: [{'keyword': 'hans', 'weight': 87}, {'keyword': 'tower', 'weight': 78}, {'keyword': 'voodoo', 'weight': 73}, {'keyword': 'black', 'weight': 69}, {'keyword': 'powers', 'weight': 68}, {'keyword': 'gothel', 'weight': 64}, {'keyword': 'heart', 'weight': 63}, {'keyword': 'traditional', 'weight': 59}, {'keyword': 'female', 'weight': 50}, {'keyword': 'phillip', 'weight': 49}, {'keyword': 'witch', 'weight': 43}, {'keyword': 'different', 'weight': 40}, {'keyword': 'dwarves', 'weight': 39}]
Unique Positive Keywords: [{'keyword': 'cute', 'weight': 45}, {'keyword': 'entertaining', 'weight': 45}, {'keyword': 'enjoyable', 'weight': 43}, {'keyword': 'visuals', 'weight': 39}, {'keyword': 'dwayne', 'weight': 39}, {'keyword': 'adventure', 'weight': 38}, {'keyword': 'hilarious', 'weight': 37}, {'keyword': 'naveen', 'weight': 37}, {'keyword': 'johnson', 'weight': 36}, {'keyword': 'excellent', 'weight': 32}, {'keyword': 'acting', 'weight': 31}, {'keyword': 'perfect', 'weight': 28}, {'keyword': 'cinderella', 'weight': 27}, {'keyword': 'greatest', 'weight': 23}, {'keyword': 'life', 'weight': 22}, {'keyword': 'fate', 'weight': 22}, {'keyword': 'today', 'weight': 22}, {'keyword': 'full', 'weight': 22}, {'keyword': 'length', 'weight': 21}, {'keyword': 'accurate', 'weight': 18}, {'keyword': 'two', 'weight': 16}, {'keyword': 'picture', 'weight': 8}, {'keyword': 'bestia', 'weight': 8}]
Unique Negative Keywords: [{'keyword': 'wan', 'weight': 7}, {'keyword': 'na', 'weight': 7}, {'keyword': 'piece', 'weight': 6}, {'keyword': 'say', 'weight': 5}, {'keyword': 'brother', 'weight': 5}, {'keyword': 'going', 'weight': 5}, {'keyword': 'e', 'weight': 5}, {'keyword': 'overall', 'weight': 4}, {'keyword': 'hate', 'weight': 4}, {'keyword': 'classics', 'weight': 4}, {'keyword': 'saying', 'weight': 4}, {'keyword': 'ive', 'weight': 4}, {'keyword': 'die', 'weight': 4}, {'keyword': 'chicken', 'weight': 4}, {'keyword': 'che', 'weight': 4}, {'keyword': 'reason', 'weight': 4}, {'keyword': 'done', 'weight': 3}, {'keyword': 'predictable', 'weight': 3}, {'keyword': 'hour', 'weight': 3}, {'keyword': 'awful', 'weight': 3}, {'keyword': 'sense', 'weight': 3}, {'keyword': 'waste', 'weight': 3}, {'keyword': 'felt', 'weight': 3}, {'keyword': 'mom', 'weight': 3}, {'keyword': 'disappointing', 'weight': 3}, {'keyword': 'humor', 'weight': 3}, {'keyword': 'us', 'weight': 3}, {'keyword': 'opinion', 'weight': 3}, {'keyword': 'cars', 'weight': 3}, {'keyword': 'care', 'weight': 3}, {'keyword': 'sorry', 'weight': 3}, {'keyword': 'guy', 'weight': 3}, {'keyword': 'wrong', 'weight': 3}, {'keyword': 'need', 'weight': 3}, {'keyword': 'wasnt', 'weight': 3}, {'keyword': 'shit', 'weight': 3}, {'keyword': 'forgettable', 'weight': 3}, {'keyword': 'saw', 'weight': 3}, {'keyword': 'experience', 'weight': 3}, {'keyword': 'find', 'weight': 3}, {'keyword': 'shes', 'weight': 3}, {'keyword': 'woman', 'weight': 3}, {'keyword': 'standup', 'weight': 2}, {'keyword': 'adults', 'weight': 2}, {'keyword': 'anything', 'weight': 2}, {'keyword': 'boring', 'weight': 2}, {'keyword': 'beauty', 'weight': 2}, {'keyword': 'worst', 'weight': 2}, {'keyword': 'minutes', 'weight': 2}, {'keyword': 'far', 'weight': 2}, {'keyword': 'worse', 'weight': 2}, {'keyword': 'nothing', 'weight': 2}, {'keyword': 'horrible', 'weight': 2}, {'keyword': 'least', 'weight': 2}, {'keyword': 'dated', 'weight': 2}, {'keyword': 'yet', 'weight': 2}, {'keyword': 'dirty', 'weight': 2}, {'keyword': 'bored', 'weight': 2}, {'keyword': 'p', 'weight': 2}, {'keyword': 'oh', 'weight': 2}, {'keyword': 'found', 'weight': 2}, {'keyword': 'gave', 'weight': 2}, {'keyword': 'christmas', 'weight': 2}, {'keyword': 'stupid', 'weight': 2}, {'keyword': 'thing', 'weight': 2}, {'keyword': 'dancing', 'weight': 2}, {'keyword': 'unless', 'weight': 2}, {'keyword': 'tangled', 'weight': 2}, {'keyword': 'recommend', 'weight': 2}, {'keyword': 'idea', 'weight': 2}, {'keyword': 'ill', 'weight': 2}, {'keyword': 'dull', 'weight': 2}, {'keyword': 'fucking', 'weight': 2}, {'keyword': 'americans', 'weight': 2}, {'keyword': 'weird', 'weight': 2}, {'keyword': 'lame', 'weight': 2}, {'keyword': 'means', 'weight': 2}, {'keyword': 'bland', 'weight': 2}, {'keyword': 'effort', 'weight': 2}, {'keyword': 'della', 'weight': 2}, {'keyword': 'non', 'weight': 2}, {'keyword': 'viene', 'weight': 2}, {'keyword': 'nel', 'weight': 2}, {'keyword': 'mai', 'weight': 2}, {'keyword': 'completely', 'weight': 2}, {'keyword': 'review', 'weight': 2}, {'keyword': 'alright', 'weight': 2}, {'keyword': 'underrated', 'weight': 2}, {'keyword': 'beyond', 'weight': 2}, {'keyword': 'standards', 'weight': 2}, {'keyword': 'went', 'weight': 2}, {'keyword': 'everything', 'weight': 2}, {'keyword': 'gets', 'weight': 2}, {'keyword': 'buy', 'weight': 2}, {'keyword': 'child', 'weight': 2}, {'keyword': 'ok', 'weight': 2}, {'keyword': 'silly', 'weight': 2}, {'keyword': 'power', 'weight': 2}, {'keyword': 'instead', 'weight': 2}, {'keyword': 'rate', 'weight': 2}, {'keyword': 'apple', 'weight': 2}, {'keyword': 'almost', 'weight': 2}, {'keyword': 'sucked', 'weight': 2}, {'keyword': 'cant', 'weight': 1}, {'keyword': 'behind', 'weight': 1}, {'keyword': 'mask', 'weight': 1}, {'keyword': 'discovered', 'weight': 1}, {'keyword': 'limitless', 'weight': 1}, {'keyword': 'stage', 'weight': 1}, {'keyword': 'comedy', 'weight': 1}, {'keyword': 'complaint', 'weight': 1}, {'keyword': 'stars', 'weight': 1}, {'keyword': 'give', 'weight': 1}, {'keyword': 'titular', 'weight': 1}, {'keyword': 'suffers', 'weight': 1}, {'keyword': 'excessive', 'weight': 1}, {'keyword': 'use', 'weight': 1}, {'keyword': 'pop', 'weight': 1}, {'keyword': 'culture', 'weight': 1}, {'keyword': 'references', 'weight': 1}, {'keyword': 'quality', 'weight': 1}, {'keyword': 'beast', 'weight': 1}, {'keyword': 'job', 'weight': 1}, {'keyword': 'despite', 'weight': 1}, {'keyword': 'ending', 'weight': 1}, {'keyword': 'works', 'weight': 1}, {'keyword': 'genii', 'weight': 1}, {'keyword': 'wasted', 'weight': 1}, {'keyword': 'opportunity', 'weight': 1}, {'keyword': 'rubbing', 'weight': 1}, {'keyword': 'jafars', 'weight': 1}, {'keyword': 'getting', 'weight': 1}, {'keyword': 'wishes', 'weight': 1}, {'keyword': 'featuring', 'weight': 1}, {'keyword': 'cast', 'weight': 1}, {'keyword': 'paige', 'weight': 1}, {'keyword': 'ohara', 'weight': 1}, {'keyword': 'jerry', 'weight': 1}, {'keyword': 'orbach', 'weight': 1}, {'keyword': 'candelabra', 'weight': 1}, {'keyword': 'angela', 'weight': 1}, {'keyword': 'lansbury', 'weight': 1}, {'keyword': 'mrs', 'weight': 1}, {'keyword': 'potts', 'weight': 1}, {'keyword': 'terrible', 'weight': 1}, {'keyword': 'annoying', 'weight': 1}, {'keyword': 'feels', 'weight': 1}, {'keyword': 'crap', 'weight': 1}, {'keyword': 'dialogue', 'weight': 1}, {'keyword': 'may', 'weight': 1}, {'keyword': 'kinda', 'weight': 1}, {'keyword': 'aged', 'weight': 1}, {'keyword': 'questionable', 'weight': 1}, {'keyword': 'decisions', 'weight': 1}, {'keyword': 'paper', 'weight': 1}, {'keyword': 'thin', 'weight': 1}, {'keyword': 'cry', 'weight': 1}, {'keyword': 'shows', 'weight': 1}, {'keyword': 'crying', 'weight': 1}, {'keyword': 'baby', 'weight': 1}, {'keyword': 'sitting', 'weight': 1}, {'keyword': 'overrated', 'weight': 1}, {'keyword': 'hated', 'weight': 1}, {'keyword': 'looped', 'weight': 1}, {'keyword': 'got', 'weight': 1}, {'keyword': 'sick', 'weight': 1}, {'keyword': 'despus', 'weight': 1}, {'keyword': 'del', 'weight': 1}, {'keyword': 'rey', 'weight': 1}, {'keyword': 'len', 'weight': 1}, {'keyword': 'mejor', 'weight': 1}, {'keyword': 'pelcula', 'weight': 1}, {'keyword': 'animacin', 'weight': 1}, {'keyword': 'cuento', 'weight': 1}, {'keyword': 'maravilloso', 'weight': 1}, {'keyword': 'por', 'weight': 1}, {'keyword': 'desgracia', 'weight': 1}, {'keyword': 'propia', 'weight': 1}, {'keyword': 'empresa', 'weight': 1}, {'keyword': 'desprecia', 'weight': 1}, {'keyword': 'con', 'weight': 1}, {'keyword': 'nueva', 'weight': 1}, {'keyword': 'versin', 'weight': 1}, {'keyword': 'weak', 'weight': 1}, {'keyword': 'sickening', 'weight': 1}, {'keyword': 'typical', 'weight': 1}, {'keyword': 'romance', 'weight': 1}, {'keyword': 'trash', 'weight': 1}, {'keyword': 'second', 'weight': 1}, {'keyword': 'goooooooooooooooooooooo', 'weight': 1}, {'keyword': 'whats', 'weight': 1}, {'keyword': 'cringe', 'weight': 1}, {'keyword': 'girly', 'weight': 1}, {'keyword': 'everyday', 'weight': 1}, {'keyword': 'water', 'weight': 1}, {'keyword': 'coke', 'weight': 1}, {'keyword': 'genuinely', 'weight': 1}, {'keyword': 'understand', 'weight': 1}, {'keyword': 'thought', 'weight': 1}, {'keyword': 'actual', 'weight': 1}, {'keyword': 'layoutsetup', 'weight': 1}, {'keyword': 'simplistic', 'weight': 1}, {'keyword': 'date', 'weight': 1}, {'keyword': 'things', 'weight': 1}, {'keyword': 'based', 'weight': 1}, {'keyword': 'events', 'weight': 1}, {'keyword': 'protagonist', 'weight': 1}, {'keyword': 'besides', 'weight': 1}, {'keyword': 'reflection', 'weight': 1}, {'keyword': 'take', 'weight': 1}, {'keyword': 'risks', 'weight': 1}, {'keyword': 'pocahontas', 'weight': 1}, {'keyword': 'hunchback', 'weight': 1}, {'keyword': 'notre', 'weight': 1}, {'keyword': 'dame', 'weight': 1}, {'keyword': 'charm', 'weight': 1}, {'keyword': 'cookie', 'weight': 1}, {'keyword': 'put', 'weight': 1}, {'keyword': 'alot', 'weight': 1}, {'keyword': 'development', 'weight': 1}, {'keyword': 'loks', 'weight': 1}, {'keyword': 'amzingly', 'weight': 1}, {'keyword': 'pure', 'weight': 1}, {'keyword': 'remain', 'weight': 1}, {'keyword': 'detail', 'weight': 1}, {'keyword': 'backgrounds', 'weight': 1}, {'keyword': 'todaytms', 'weight': 1}, {'keyword': 'shame', 'weight': 1}, {'keyword': 'treat', 'weight': 1}, {'keyword': 'whites', 'weight': 1}, {'keyword': 'annoyed', 'weight': 1}, {'keyword': 'fact', 'weight': 1}, {'keyword': 'dumb', 'weight': 1}, {'keyword': 'eat', 'weight': 1}, {'keyword': 'given', 'weight': 1}, {'keyword': 'creepy', 'weight': 1}, {'keyword': 'villainess', 'weight': 1}, {'keyword': 'crazy', 'weight': 1}, {'keyword': 'tiny', 'weight': 1}, {'keyword': 'german', 'weight': 1}, {'keyword': 'endgame', 'weight': 1}, {'keyword': 'fuck', 'weight': 1}, {'keyword': 'theaters', 'weight': 1}, {'keyword': 'playing', 'weight': 1}, {'keyword': 'meh', 'weight': 1}, {'keyword': 'maked', 'weight': 1}, {'keyword': 'fall', 'weight': 1}, {'keyword': 'asleep', 'weight': 1}, {'keyword': 'hollow', 'weight': 1}, {'keyword': 'horrifying', 'weight': 1}, {'keyword': 'foot', 'weight': 1}, {'keyword': 'porn', 'weight': 1}, {'keyword': 'contemporary', 'weight': 1}, {'keyword': 'musicals', 'weight': 1}, {'keyword': 'changed', 'weight': 1}, {'keyword': 'game', 'weight': 1}, {'keyword': 'u', 'weight': 1}, {'keyword': 'working', 'weight': 1}, {'keyword': 'halfremembered', 'weight': 1}, {'keyword': 'recipe', 'weight': 1}, {'keyword': 'tried', 'weight': 1}, {'keyword': 'whip', 'weight': 1}, {'keyword': 'together', 'weight': 1}, {'keyword': 'quintessential', 'weight': 1}, {'keyword': 'girlfriend', 'weight': 1}, {'keyword': 'churning', 'weight': 1}, {'keyword': 'cold', 'weight': 1}, {'keyword': 'comforts', 'weight': 1}, {'keyword': 'millenials', 'weight': 1}, {'keyword': 'theyd', 'weight': 1}, {'keyword': 'jealously', 'weight': 1}, {'keyword': 'raised', 'weight': 1}, {'keyword': 'aidan', 'weight': 1}, {'keyword': 'fail', 'weight': 1}, {'keyword': 'drives', 'weight': 1}]

Words most commonly mentioned across all reviews

- most commonly mentioned words
- most commonly mentioned words with positive sentiments
- most commonly mentioned words with negative sentiments
Show Code
import pandas as pd
from textblob import TextBlob
from collections import Counter
from wordcloud import WordCloud
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
import nltk

nltk.download('stopwords')
stop_words = set(stopwords.words('english'))

# 1. Perform sentiment analysis on the "review_text" column
def sentiment_analysis(text):
    blob = TextBlob(text)
    return blob.sentiment.polarity  # Returns sentiment polarity (-1 to 1)

# 2. Classify sentiment into five categories
def classify_sentiment(score):
    if score >= 0.6:
        return 'Very Positive'
    elif score >= 0.2:
        return 'Positive'
    elif score > -0.2:
        return 'Neutral'
    elif score > -0.6:
        return 'Negative'
    else:
        return 'Very Negative'

# 3. Extract keywords and calculate their weights, removing stop words
def get_keywords(text_list, top_n=50):
    all_words = ' '.join(text_list).split()  # Combine all text and split into words
    filtered_words = [word for word in all_words if word.lower() not in stop_words]
    word_counts = Counter(filtered_words)  # Count word frequencies
    return word_counts.most_common(top_n)  # Get the top N keywords and their weights

# List of CSV files to process
csv_files = [
    "aladdin_processed_data.csv",
    "beauty_and_the_beast_processed_data.csv",
    "brave_processed_data.csv",
    "cinderella_processed_data.csv",
    "frozen_processed_data.csv",
    "little_mermaid_processed_data.csv",
    "moana_processed_data.csv",
    "mulan_processed_data.csv",
    "pocahontas_processed_data.csv",
    "princess_and_the_frog_processed_data.csv",
    "sleeping_beauty_processed_data.csv",
    "snow_white_processed_data.csv",
    "tangled_processed_data.csv"
]

# Initialize lists to store keywords
all_keywords_list = []
positive_keywords_list = []
negative_keywords_list = []

# Process each CSV file
for file in csv_files:
    df = pd.read_csv(f"../../data/processed-data/{file}")
    
    # Filter out non-string values in the 'review_text' column
    df = df[df['review_text'].apply(lambda x: isinstance(x, str))]
    
    # Perform sentiment analysis
    df['sentiment_score'] = df['review_text'].apply(sentiment_analysis)
    df['sentiment_category'] = df['sentiment_score'].apply(classify_sentiment)
    
    # Extract keywords
    all_keywords = get_keywords(df['review_text'].tolist())
    positive_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Positive', 'Positive'])]['review_text'].tolist())
    negative_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Negative', 'Negative'])]['review_text'].tolist())
    
    # Store keywords and weights in lists
    all_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in all_keywords])
    positive_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in positive_keywords])
    negative_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in negative_keywords])

# Remove duplicates and sort by weight
all_keywords_list = sorted(list({v['keyword']: v for v in all_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
positive_keywords_list = sorted(list({v['keyword']: v for v in positive_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
negative_keywords_list = sorted(list({v['keyword']: v for v in negative_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)

# Generate word clouds for each category
def generate_wordcloud(keywords_list, title):
    wordcloud = WordCloud(width=800, height=400, background_color='white').generate_from_frequencies(dict(keywords_list))
    plt.figure(figsize=(10, 5))
    plt.imshow(wordcloud, interpolation='bilinear')
    plt.title(title, fontsize=15)
    plt.axis('off')
    plt.show()

# Display word clouds
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in all_keywords_list], "Common Keywords")
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in positive_keywords_list], "Positive Keywords")
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in negative_keywords_list], "Negative Keywords")
[nltk_data] Downloading package stopwords to
[nltk_data]     C:\Users\tongrui\AppData\Roaming\nltk_data...
[nltk_data]   Package stopwords is already up-to-date!

Word Frequency most commonly mentioned in all reviews

- After using extra stopwords to eliminate useless words, princess names, disney
Show Code
import pandas as pd
from textblob import TextBlob
from collections import Counter
from wordcloud import WordCloud
import matplotlib.pyplot as plt
from nltk.corpus import stopwords
import nltk

nltk.download('stopwords')
stop_words = set(stopwords.words('english'))

extra_stop_words = {"movie", "disney", "mulan", "aladdin","moana","snow","cinderella","tangled","white","go","rapunzel","elsa","film","robin","robbin","williams","Elsa","pixar","pocahontas","little","mermaid","brave","sleeping","beauty","frog","let","anna","maleficent"}
stop_words.update(extra_stop_words)

# 1. Perform sentiment analysis on the "review_text" column
def sentiment_analysis(text):
    blob = TextBlob(text)
    return blob.sentiment.polarity  # Returns sentiment polarity (-1 to 1)

# 2. Classify sentiment into five categories
def classify_sentiment(score):
    if score >= 0.6:
        return 'Very Positive'
    elif score >= 0.2:
        return 'Positive'
    elif score > -0.2:
        return 'Neutral'
    elif score > -0.6:
        return 'Negative'
    else:
        return 'Very Negative'

# 3. Extract keywords and calculate their weights, removing stop words
def get_keywords(text_list, top_n=50):
    all_words = ' '.join(text_list).split()  # Combine all text and split into words
    filtered_words = [word for word in all_words if word.lower() not in stop_words]
    word_counts = Counter(filtered_words)  # Count word frequencies
    return word_counts.most_common(top_n)  # Get the top N keywords and their weights

# List of CSV files to process
csv_files = [
    "aladdin_processed_data.csv",
    "beauty_and_the_beast_processed_data.csv",
    "brave_processed_data.csv",
    "cinderella_processed_data.csv",
    "frozen_processed_data.csv",
    "little_mermaid_processed_data.csv",
    "moana_processed_data.csv",
    "mulan_processed_data.csv",
    "pocahontas_processed_data.csv",
    "princess_and_the_frog_processed_data.csv",
    "sleeping_beauty_processed_data.csv",
    "snow_white_processed_data.csv",
    "tangled_processed_data.csv"
]

# Initialize lists to store keywords
all_keywords_list = []
positive_keywords_list = []
negative_keywords_list = []

# Process each CSV file
for file in csv_files:
    df = pd.read_csv(f"../../data/processed-data/{file}")
    
    # Filter out non-string values in the 'review_text' column
    df = df[df['review_text'].apply(lambda x: isinstance(x, str))]
    
    # Perform sentiment analysis
    df['sentiment_score'] = df['review_text'].apply(sentiment_analysis)
    df['sentiment_category'] = df['sentiment_score'].apply(classify_sentiment)
    
    # Extract keywords
    all_keywords = get_keywords(df['review_text'].tolist())
    positive_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Positive', 'Positive'])]['review_text'].tolist())
    negative_keywords = get_keywords(df[df['sentiment_category'].isin(['Very Negative', 'Negative'])]['review_text'].tolist())
    
    # Store keywords and weights in lists
    all_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in all_keywords])
    positive_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in positive_keywords])
    negative_keywords_list.extend([{"keyword": word, "weight": weight} for word, weight in negative_keywords])

# Remove duplicates and sort by weight
all_keywords_list = sorted(list({v['keyword']: v for v in all_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
positive_keywords_list = sorted(list({v['keyword']: v for v in positive_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)
negative_keywords_list = sorted(list({v['keyword']: v for v in negative_keywords_list}.values()), key=lambda x: x['weight'], reverse=True)

# Generate word clouds for each category
def generate_wordcloud(keywords_list, title):
    wordcloud = WordCloud(width=800, height=400, background_color='white', stopwords=stop_words).generate_from_frequencies(dict(keywords_list))
    plt.figure(figsize=(10, 5))
    plt.imshow(wordcloud, interpolation='bilinear')
    plt.title(title, fontsize=15)
    plt.axis('off')
    plt.show()

# Display word clouds
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in all_keywords_list], "Common Keywords")
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in positive_keywords_list], "Positive Keywords")
generate_wordcloud([(kw['keyword'], kw['weight']) for kw in negative_keywords_list], "Negative Keywords")
[nltk_data] Downloading package stopwords to
[nltk_data]     C:\Users\tongrui\AppData\Roaming\nltk_data...
[nltk_data]   Package stopwords is already up-to-date!