/csulbdataday24M

Music Repo for sentiment analysis configuration

Primary LanguageHTMLMIT LicenseMIT

Sentiment Analysis Visualization

Musical Artist Sentiment Analysis

Authors

Table of Contents

Getting Started

The focus of this project will be on Sentiment Analysi on music data(spotify).

Library Installation

Ensure you have R and RStudio installed on your computer. RStudio provides an integrated development environment (IDE) that makes coding in R easier. Or Posit Cloud

Data Source

Data was extracted using a Token API using spotify access. For further replication on the use of an Spotify API.

For Posit Cloud :

  • Click here
  • Quick Glance

    Sentiment Analysis Visualization

    Sentiment Analysis Visualization

    Steps

    Step 1: Setting Up Your Environment

    Install R and RStudio. Use RStudio's IDE for ease of development.

    Install required libraries with the command:

        install.packages(c("tidyverse", "tidytext", "ggwordcloud", "ggtext", "showtext", "gt"))
    

    Step 2: Load the Libraries

    Load the necessary libraries in R:

        
    library(tidyverse)
    library(tidytext)
    library(ggwordcloud)
    library(ggtext)
    library(showtext)
    library(gt)
        
    

    Step 3: Getting and Preparing Your Data

    • Choose your data source, focusing on the musical artist and songs for analysis.
    • Load your data with read_csv("path/to/your/data.csv").
    • Clean your data to prepare it for analysis.

    Step 4: Text Processing

    Tokenize the lyrics into individual words using tidytext::unnest_tokens() and filter out common stop words.

    Step 5: Sentiment Analysis

    Choose a sentiment lexicon and match words to sentiments. Example:

        
    bing_sentiments <- tidy_df %>%
      inner_join(get_sentiments("bing")) %>%
      count(word, sentiment, sort = TRUE)
        
    

    Step 6: Visualization and Interpretation

    • Visualize common words with word clouds.
    • Plot frequency of sentiments with ggplot2.
    • Analyze results for trends in sentiment.

    Sentiment Analysis Visualization

    Step 7: Share Your Findings

    Compile your analysis into a report using Quattro or R markdown. Share on Github. Use as a project for resume.

    Sentiment Analysis Visualization

    End Goal

    This project aims to inspire both students and data science enthusiasts to undertake their own projects, with the aspiration that through continued practice, they'll gain a deeper appreciation for the boundless creativity and narrative potential inherent in data and visualizations. For more insights and inspiration, consider exploring Andres's Medium post on the sentiment analysis of The Smiths, a quintessential English band that dominated the 80s: https://medium.com/@gonzalez_afc/sentiment-analysis-of-the-the-smiths-a-quintessential-english-band-that-ruled-the-80s-173266b1d697

    THANK YOU!