Hello, today i want to make a Wordcloud from Google Play reviews, I'd make explanation about wordcloud in detail, You can check right here: Wordcloud, I also teach you how to make wordcloud that match the shape we desire, however i want to make Wordcloud from Google Play reviews, we can use this if we have an App and we want to make Sentiment analysis to improve our app that we're developing.
Let us get started!
First we must import the module we need, here i used Google Colab so i need to import from google drive as an additional module to make things convenient
# Contoh teks
teks_asli = "Ini Adalah Contoh Teks yang Akan Dikonversi Menjadi Lowercase."
# Mengubah teks menjadi lowercase
teks_lowercase = teks_asli.lower()
# Menampilkan hasil
print("Teks asli:", teks_asli)
print("Teks setelah diubah menjadi lowercase:", teks_lowercase)
There is a module for scraping google play review, however it wasn't installed on the jupyter book yet so we need to install the module first: !pip install google-play-scraper
Then we import to scrape module: from google_play_scraper import app, reviews, Sort, reviews_all
from google.colab import drive
drive.mount('/content/drive')
scrapreviews, _ = reviews(
'com.spotify.music', #important to find the Package ID of an app
lang='en',
country='gb',
sort=Sort.NEWEST,
count=1000
)
Here i only want to import 1000 with count=1000 instead of using reviews_all() because it will take alot of time
lang='en': sets the language to English
country='gb': Here i select the region GB or Great Britain
sort=Sort.NEWEST: sort the newest reviews
Then we type to scrapreviews shows the result, the result is so long and could be different because this sort the newest review so be in mind
Here i want to saves the result to csv to save the result i have,
app_reviews_df = pd.DataFrame(scrapreviews)
app_reviews_df.shape
app_reviews_df.head()
app_reviews_df.to_csv('customer_review_of_spotify.csv', index=False)
# Membuat DataFrame dari hasil scrapreview
# Menghitung jumlah baris dan kolom dalam DataFrame
reviews_number, columns_number = app_reviews_df.shape
print (reviews_number, columns_number )
app_reviews_df = pd.DataFrame(scrapreviews): app_reviews_df is a new variable, and we create new dataframe from the
app_reviews_df.shape: To see the shape of the dataframe
app_reviews_df.head(): This code is used quickly to see first rows
app_reviews_df.to_csv('customer_review_of_spotify.csv', index=False): Save the CSV using pandas
reviews_number, columns_number = app_reviews_df.shape
print (reviews_number, columns_number ): In here the app_reviews_df.shape return tuple so we make the 2 new variable
according to the tuple order so we get colums and rows number, in here i change the name "rows" to "reviews"
Then i type to see the result of the dataframe we have, again, same as when i type scrapreviews to show the result please be in mind that the result would be different
# Creating word_cloud with text as argument in .generate() method
text1 = " ".join(title for title in app_reviews_df.content if title is not None)
word_cloud1 = WordCloud(collocations = False, background_color = 'white',
width = 2048, height = 1080).generate(text1)
word_cloud1.to_file('/content/drive/Mydrive/spotify_wordcloud.png')
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been ther took It has survived not only five centuries, but also the leap into electronic
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been ther took It has survived not only five centuries, but also the leap into electronic
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic but also the leap into electronic.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic but also the leap into electronic.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic but also the leap into electronic.
06 minute read
06 minute read
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy Lorem Ipsum has been the industry's standard dummy type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic
Sports
Get the best speak market, news. December 9, 2024Technology
Get the best speak market, news. December 9, 2024Fashion
Get the best speak market, news. December 9, 2024Life Style
Get the best speak market, news. December 9, 2024