Bachelor of Business Administration @PNU/Marketing Analytics

선행 연구 -1 | Pilot Study - 1 (24.02.2022.)

Hazel Y. 2022. 4. 14. 15:44

내가 연구 주제를 정하는 것에 애를 먹고 있자, 교수님께서 나에게 일단 선행 연구를 해보라고 조언해주셨다. 그러면 그 선행 연구를 통해서 몇 가지 연구 아이디어가 떠오를 수도 있다고 하셨다.

 

Since I was struggling to come up with a research topic, the professor told me to do a pilot study so that I could get some research ideas through it.


1. Dataset

 

  • newly collected
  • [brand, product, review, date] → [brand, product, review, date, rating, helpful]
  • rating == review score == 별점(평점) == 1~5 out of 5
  • helpful == 도움 수

나는 이전 웹 크롤링 포스트에서 소개한 코드로 수집한 데이터 외에 별점과 도움 수라는 두 가지의 데이터를 더 수집했다. 그 이유는 별 건 없고 차후 분석 때 혹시나 사용될 경우를 대비하기 위함이었다. 새롭게 진행한 웹 크롤링의 코드를 보고 싶다면, 아래 링크로 연결된 포스트로 가길 바란다.

 

I collected two more types of data, rating and helpful, just in case they will be used for further analyses. For the new web crawling code, please go to the following post:

https://livelyhheesun.tistory.com/7

 

Sephora Review Web Crawling-2 (24.02.2022.)

Since I decided to collect rating and helpfulness data from the Sephora webpage, I slightly changed the web crawling code. 1. Import necessary packages. import time import openpyxl from openpyxl imp..

livelyhheesun.tistory.com


2. Word frequency analysis

 

  • successful product reviews

20 most frequently mentioned words in successful product reviews
Wordcloud made with 20 most frequently mentioned words above

 

  • unsuccessful product reviews

20 most frequently mentioned words in unsuccessful product reviews
Wordcloud made with 20 most frequently mentioned words above

 

  • common words: lashes(eyelashes), like, one, look, really, product, eyes(eye), get, day, use, curl, used
  • only in successful product reviews: long, brush, great, tried, makes, volume
  • only in unsuccessful product reviews: makeup, waterproof, would, remover, even

위의 단어 빈도 분석 결과에 따라, 나는 두 종류의 제품들을 구매한 소비자들이 제품 자체 뿐만 아니라 속눈썹 컬링 효과, 볼류마이징 효과 등과 같은 제품 사용 효과 및 결과에 대한 것에도 관심이 많다고 추측해본다.

성공적인 제품들을 구입한 이들 중 많은 사람들이 속눈썹 연장 및 볼류마이징 효과를 언급했다. 또한, 그들은 제품의 브러쉬 부분에 관심이 많았다.

반면, 성공하지 않은 제품들의 소비자들은 제품의 롱래스팅 기능과 제품을 쉽게 지울 수 있는지를 많이 언급했다.

단어 빈도 분석 파이썬 코드: 아래 링크 참고

 

I roughly guess consumers from both types of products were interested not only in the products themselves but also in how they look like after applying the products, especially how curlier the products make their eyelashes.

Many of those who bought the successful products mentioned the lengthening and volumizing effect of the products. Also, they were interested in their brushes.

However, consumers of unsuccessful products mentioned long-lasting and removable features of the products a lot.

For the word frequency analysis code, please go to the following post:

https://livelyhheesun.tistory.com/8

 

Word Frequency Analysis (24.02.2022.)

The following are the steps and codes that I used for the word frequency analysis for each of the successful and unsuccessful product reviews. 1. Import necessary packages. import pandas as pd impor..

livelyhheesun.tistory.com


3. Sentiment analysis

 

  • unsupervised learning

 

  • predicted sentiment (threshold = 0.1) → only with review text
    • using SentimentIntensityAnalyzer()
    • compound (총 감성지수) > 0.1 → 1 (positive)
    • -0.1 <= compound <= 0.1 → 0 (neutral)
    • compound < -0.1 → -1 (negative)
  • real sentiment → only with review score (별점(평점))
    • review score >= 4 → 1 (positive)
    • review score == 3 → 0 (neutral)
    • review score <= 2 → -1 (negative)

감성 분석의 경우, 일단은 비지도 학습으로 진행하였다. 나는 SentimentIntensityAnalyzer()를 사용하였는데, 이는 nltk.sentiment.vader 모듈의 한 클래스이며 문장에 감성 강도 점수를 부여한다. 한계점의 경우 0.1로 설정하였는데, 이는 그것이 가장 널리 사용되는 한계점 파라미터이기 때문이다.

나는 4점 혹은 5점의 별점을 가진 리뷰는 긍정으로, 3점 리뷰는 중립으로, 그리고 1점 혹은 2점의 리뷰는 부정으로 간주했다. (그러나, 교수님께서 나에게 그 기준을 바꾸라고 조언해주셨다. 예를 들어 4점 리뷰의 경우 그 리뷰의 작성자가 제품과 관련된 어떤 부정적 경험을 했는 등 분명 1점을 제한 이유가 있을 것이기 때문이라고 하셨다.)

 

First, I tried an unsupervised learning sentiment analysis. I used SentimentIntensityAnalyzer(), which is a class from the nltk.sentiment.vader module that gives a sentiment intensity score to sentences. And I set up the threshold to 0.1 because it is the most widely used threshold parameter.

I considered reviews with four or five stars out of five positive, reviews with three neutral, and reviews with one or two negative. (But the professor told me to change the criteria since, for example, people who gave four have some reasons to do so. They must have some slight negative experience or thoughts about the product to deduct one from five.)


  • Successful product reviews
    • psentl: predicted sentiment labels
    • sent: real sentiment labels

Dataframe of successful product reviews after adding predicted and real sentiment columns
Accuracy, precision, recall, and F1 score of the unsupervised learning sentiment analysis with successful product reviews

 


  • 정확도: 예측값과 정답값이 얼마나 정확한가
  • 정밀도: 예측값의 몇 퍼센트가 정답값과 일치하는가
  • 재현율: 예측값이 정답값의 몇 퍼센트를 맞췄는가
  • F1 스코어: 정밀도와 재현율의 평균값

 

  • Accuracy score: How accurate are the prediction and the answer?
  • Precision score: What percentage of the prediction is corresponding to the answer?
  • Recall score: What percentage of the answer does the model(prediction) get right?
  • F1 score: Average value of precision and recall score

Predicted sentiment for successful product reviews
Real sentiment for successful product reviews

 


< 성공한 제품 (successful products) >

 

예상한 바와 같이, 성공한 제품에 대한 예측 감성과 실제 감성 모두 긍정적 리뷰가 가장 높은 비율을 차지하고 있다는 것을 보여준다. 그리고 중립 리뷰의 비율이 가장 낮은 이유는 예측 감성의 경우 감성 강도 점수가 0.1이거나 실제 감성의 경우 3점인 경우만 포함하고 있기 때문이라고 생각했다.

SentimentIntensityAnalyzer()는 실제보다 더 많은 리뷰를 긍정적으로, 더 적은 리뷰를 부정적으로 예측했다.

F1 스코어의 경우, 그렇게 높지 않다. 하지만, 이는 실제 감성 라벨링에 대한 기준을 교수님께서 말씀해주신 것처럼(1 - 부정, 2~4 - 중립, 5 - 긍정) 설정한다면 향상될 수 있다. 혹은 다른 감성 분석 기법이나 모델들을 추후 시도해보는 것도 하나의 방법일 것이다. (요즘 BERT 감성 분석을 진행 중인데, 그것도 곧 포스팅할 예정이다.)

 

As I expected, both predicted and real sentiment for successful product reviews showed that positive reviews have the highest proportion. And I think the reason why neutral is the lowest is that it only involves reviews with a compound of 0.1 or with a score of three, which makes sense.

The SentimentIntensityAnalyzer() predicted more reviews are positive and fewer reviews are negative than the real.

The F1 score is not that high, but this can be improved if I set up the criteria for the real sentiment labeling as the professor said. Or I should probably try other sentiment analysis methods or models further. (Recently, I tried using BERT classifier for sentiment analysis, and I will post it soon.)


  • Unsuccessful product reviews

Dataframe of unsuccessful product reviews after adding predicted and real sentiment columns
Accuracy, precision, recall, and F1 score of the unsupervised learning sentiment analysis with unsuccessful product reviews
Predicted sentiment for unsuccessful product reviews
Real sentiment for unsuccessful product reviews


  • Based on the review texts...
    • positive > negative
  • Based on the review scores...
    • positive < negative
  • Is there any difference between writing texts and giving review scores?
  • What kind of insight can be drawn from this?

< 성공하지 않은 제품 (unsuccessful products) >

 

(다시 말하자면, 아래의 결과는 실제 감성 기준을 바꾸면 달라질 수 있다.)

SentimentIntensityAnalyzer()을 사용하여 비지도 학습 감성 분석을 한 예측에 의하면 긍정적 리뷰의 수가 부정적 리뷰의 수보다 많았다. 이는 내가 예상한 바와 정반대이다.

또, 여기에서도 F1 스코어가 그렇게 높지 않다.

비지도 학습을 통한 감성 분석 코드: 아래 링크 참고

 

(Again, this result can be changed as the real sentiment criteria changes.)

It is interesting to see that according to the prediction(unsupervised sentiment analysis using SentimentIntensityAnalyzer()), there are more positive reviews than negative ones. This is the total opposite of what I expected.

Also, here, the F1 score is not that high.

For the unsupervised learning sentiment analysis code, please go to the following post:

https://livelyhheesun.tistory.com/9

 

Sentiment Analysis - Unsupervised Learning (24.02.2022.)

The following are the steps and codes for sentiment analysis using the unsupervised learning method. 1. Import necessary packages. import pandas as pd import matplotlib.pyplot as plt import re impor..

livelyhheesun.tistory.com

 

 

 

* Unauthorized copying and distribution of this post are not allowed.

* 해당 글에 대한 무단 배포 및 복사를 허용하지 않습니다.