Skip to content

Commit f43f4a8

Browse files
authored
Merge pull request #53 from UCSB-Library-Research-Data-Services/renata
Sentiment Analysis
2 parents cb6990c + 95b8dc2 commit f43f4a8

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

_quarto.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ website:
6363
text: Introduction to Sentiment Analysis
6464
- href: chapters/3.SentimentAnalysis/polarity.qmd
6565
text: Polarity Classification
66-
- href: chapters/3.SentimentAnalysis/polarity.qmd
67-
text: Polarity Classification
6866
- href: chapters/3.SentimentAnalysis/emotion.qmd
6967
text: Emotion Detection
7068
- about.qmd
@@ -86,5 +84,4 @@ format:
8684
page-layout: full
8785
code-line-numbers: false
8886
code-fold: false
89-
code-tools: true
90-
87+
code-tools: true

chapters/3.SentimentAnalysis/introduction.qmd

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,18 @@ While the analysis of public opinion predates the Internet, the modern field of
1818
1919
Whether through product reviews, political commentary, or social media posts in virtually any possible topic of interest, sentiment analysis aims to quantify and interpret subjective information at scale, enabling applications in marketing, social science, finance, and beyond. In this course, we will explore ways of extracting insights from textual data, in particular how we can detect underlying emotions within messages shared by people on a popular streaming TV series.
2020

21-
Our analysis pipeline will follow a two-step approach. First, we will compute basic sentiment polarity to determine whether viewers who commented on both season finales reacted more negatively, neutrally, or positively. Next, we will apply a more fine-grained emotion detection technique to capture and analyze the specific emotional expressions conveyed in the text.
21+
Our analysis pipeline will follow a two-step approach. First, we will compute basic sentiment polarity to determine whether viewers who commented on both season finales reacted more negatively, neutrally, or positively. Next, we will apply a more fine-grained emotion detection technique to capture and analyze the specific emotional expressions conveyed in the text.
22+
23+
Let’s start by installing and loading the necessary packages, then bringing in the cleaned dataset so we can begin our sentiment analysis. We will discuss the role of each package in the next episodes.
24+
25+
``` r
26+
# Install Packages
27+
install.packages(c("sentimentr", "syuzhet"))
28+
29+
# Load Packages
30+
library(sentimentr)
31+
library(syuzhet)
32+
33+
# Load Data
34+
comments <- readr::read_csv("../data/clean/comments_preprocessed.csv")
35+
```

0 commit comments

Comments
 (0)