Skip to content

R library used for scraping, extracting, sentimentally analyzing reviews, and visualizing word cloud.

Notifications You must be signed in to change notification settings

jyanqa/Check-if-Amazon-rating-is-reliable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check if Amazon rating is reliable

IfamazonratingsReliable is a package used for sentimentally analyzing reviews of Amazon UK products. Certain words from buyer's reviews will be assigned to either positive value or negative value using Bing lexicon. If the number of negative words accounts for more than 40% of the total words, the product is considered as having got BAD reviews.

Installation

# first install the R package "devtools" if not installed
devtools::install_github('unimi-dse/46ab540a')

Usage

# load the package
require(IfamazonratingsReliable)

Function

Function to extract reviews from one page

scrape_reviews(url,page_num)
Click to copy example scrape_reviews('https://www.amazon.co.uk/NatraCure-5-Toe-Moisturising-Socks-Cracked/dp/B00O81S77A/ref=pd_rhf_cr_p_img_4?_encoding=UTF8&psc=1&refRID=VJCM7BVD23A999WADERA',2)

Function to extract reviews from multiple pages

multiple_scrape(url,page_rage)
Click to copy example multiple_scrape('https://www.amazon.co.uk/find-PHRL3236-Mens-Jumpers-Off-White/dp/B004I8VJ1Y?pf_rd_p=190f0313-4dcb-4239-b2ce-39f9d6bd3b5c&pd_rd_wg=NzF31&pf_rd_r=WJ0HCRPD99CTHV8XN0K0&ref_=pd_gw_unk&pd_rd_w=yoPcr&pd_rd_r=2a39592b-aee9-47b5-a65e-862257e0f4df&th=1',1:4)

Function to check if the product got positive reviews in general

GetSentiment(url,page_rage)
Click to copy example GetSentiment('https://www.amazon.co.uk/find-PHRL3236-Mens-Jumpers-Off-White/dp/B004I8VJ1Y?pf_rd_p=190f0313-4dcb-4239-b2ce-39f9d6bd3b5c&pd_rd_wg=NzF31&pf_rd_r=WJ0HCRPD99CTHV8XN0K0&ref_=pd_gw_unk&pd_rd_w=yoPcr&pd_rd_r=2a39592b-aee9-47b5-a65e-862257e0f4df&th=1',1:2)

Function to visualize negative and positive words

plotbing(url,page_rage)
Click to copy example plotbing('https://www.amazon.co.uk/find-PHRL3236-Mens-Jumpers-Off-White/dp/B004I8VJ1Y?pf_rd_p=190f0313-4dcb-4239-b2ce-39f9d6bd3b5c&pd_rd_wg=NzF31&pf_rd_r=WJ0HCRPD99CTHV8XN0K0&ref_=pd_gw_unk&pd_rd_w=yoPcr&pd_rd_r=2a39592b-aee9-47b5-a65e-862257e0f4df&th=1',1:4)

License

GPL-3

Author

Nguyen Quynh Anh

:octocat: jyanqa

Note: Only for Mac OS users This package uses X11 library (including tcltk), thus XQuartz is required to be installed since it is no longer part of OS X. Read on R CRAN for more details.

About

R library used for scraping, extracting, sentimentally analyzing reviews, and visualizing word cloud.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages