How gokulakrishnan-1/sentiment-analysis-project-on-amazon-reviews works
Project type and purpose
• This is a data-analysis mini-project written in R. Its purpose is to perform sentiment analysis on Amazon reviews for the book “The Psychology of Money” and display the emotional distribution in a bar plot.
File structure
• Top-level:
• Amazon Review Sentiment Analysis.R — the single R script containing the entire analysis pipeline
• README.md — project overview and instructions
• No separate directories for data, modules, or outputs—everything is in one script.
README for additional insights
• Data ingestion via read.csv
• Text converted and analyzed using the Syuzhet package and NRC lexicon
• Output is a bar plot of emotional categories (positive, negative, anger, joy, etc.)
a. Main components:
1. Data Source
– Input CSV file of Amazon reviews
2. Data Ingestion Module
– R’s read.csv
3. Text Preprocessing Module
– Lower-casing, punctuation removal, tokenization
4. Sentiment Analysis Module
– Syuzhet functions + NRC Word-Emotion Lexicon
5. Aggregation & Scoring Module
– Compute counts/scores per emotion category
6. Visualization Module
– ggplot2 or base R bar plot
7. Output
– Final bar plot PNG or display
8. Environment & Dependencies
– R interpreter, Syuzhet library, NRC lexicon data
b. Relationships and data flow
• From Ingestion → Preprocessing → Sentiment Analysis → Aggregation → Visualization → Output
c. Architectural patterns & principles
– Linear data-pipeline pattern: stepwise transformation
– Modularity: each step is a logical component, even if implemented in one script
– Dependency injection: external lexicon and package
d. Key technologies/frameworks
– R language
– Syuzhet package
– NRC Word-Emotion Association Lexicon
– ggplot2 or base graphics (depending on implementation)