From 41bc409a0d0a8d07b374d331e52bf826c2960a55 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 11 Nov 2025 18:39:47 +0100 Subject: [PATCH] Add another sentiment review --- .../example/senti/ProductReviewAnalyzer.java | 3 ++- .../main/resources/new_product_reviews.csv | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 SentimentAnalysisLab/src/main/resources/new_product_reviews.csv diff --git a/SentimentAnalysisLab/src/main/java/com/example/senti/ProductReviewAnalyzer.java b/SentimentAnalysisLab/src/main/java/com/example/senti/ProductReviewAnalyzer.java index c61de54..aa3bed8 100644 --- a/SentimentAnalysisLab/src/main/java/com/example/senti/ProductReviewAnalyzer.java +++ b/SentimentAnalysisLab/src/main/java/com/example/senti/ProductReviewAnalyzer.java @@ -25,7 +25,8 @@ public class ProductReviewAnalyzer { try { // Load reviews from CSV - List reviews = analyzer.loadReviews("/product_reviews.csv"); + //List reviews = analyzer.loadReviews("/product_reviews.csv"); + List reviews = analyzer.loadReviews("/new_product_reviews.csv"); Map sentimentDistribution = new LinkedHashMap<>(); sentimentDistribution.put("Very Positive", 0); sentimentDistribution.put("Positive", 0); diff --git a/SentimentAnalysisLab/src/main/resources/new_product_reviews.csv b/SentimentAnalysisLab/src/main/resources/new_product_reviews.csv new file mode 100644 index 0000000..ac0d799 --- /dev/null +++ b/SentimentAnalysisLab/src/main/resources/new_product_reviews.csv @@ -0,0 +1,21 @@ +review_id,review_text,sentiment +1,"This is simply the best product available on the market." +2,"It broke on the first use and I do not recommend it." +3,"This phenomenal product completely changed my life!" +4,"Terrible durability. Cheaply made." +5,"This is a huge disappointment and I cannot recommend it." +6,"I am absolutely in love with this perfect product!" +7,"This broken product is useless junk and I demand a replacement." +8,"The item is acceptable and matches its description." +9,"It functions as described in the product listing." +10,"This fantastic product makes me incredibly happy!" +11,"The product functions as intended." +12,"This is a really good product that works well." +13,"This extremely poor quality product broke immediately." +14,"This is a dreadful product was a complete waste of money." +15,"It arrived on the expected delivery date." +16,"This product is completely useless." +17,"This is a solid and reliable product." +18,"I am totally amazed by this wonderfully valuable product." +19,"This is the worst product I have ever owned." +20,"The quality of this product is outstanding and perfect." \ No newline at end of file