Thursday 9 November 2017

Analysis of Modi’s Speech on 29/10/2017- using Sentimental Analysis(PART-3)


Analysis of Modi’s Speech on 29/10/2017- using Text Analysis(PART-3)
Lets start looking at the raw data
## [1] "\n\n  * from the days of khadi for nation, we came to see khadi for fashion, and now the country is moving towards 'khadi for transformation'\n  \n  * this year, there has been an increase of nearly 90 per cent in sale of handloom and khadi products over previous year. this will have proved beneficial for the poor craftsmen\n  \n  * people asked on the nm app whether they could somehow send sweets on the occasion of diwali to the soldiers at the borders\n  \n  * celebrating diwali with the jawans at gurez was an unforgettable experience for me\n  \n  * not only are our soldiers safeguarding the borders, they are helping keep the peace all across the world. more than 18,000 indian soldiers have contributed to un peacekeeping missions\n  \n  * currently 7,000 soldiers indian troops are deployed with un peacekeeping initiatives, it's third highest in the world\n  \n  * indian women soldiers have contributed significantly to peacekeeping missions and india was first nation to send a female police unit to peacekeeping mission in liberia\n  \n  * the united nations declaration of human rights is testimony to india's push for gender equality. article 01, which began, \"all men are born free and equal in dignity and rights\" was changed to \"all human beings are born free and equal in dignity and rights\" due to the constant efforts of hansa mehta\n  \n  * india has always spread the message of peace, unity and goodwill. we believe that everyone should live in harmony and move towards building a better and peaceful tomorrow\n  \n  * after 10 years india won asia cup. i congratulate entire team and the support staff\n  \n  * young indian players won hearts of fans during the fifa under-17 world cup. future of football is bright in india\n  \n  * outdoor activities are a must for children. elders must encourage children to move out and play in open field\n  \n  * yoga for young india! yoga will help our children from lifestyle disorders\n  \n  * a ngo called ecological protection organization launched a cleanliness campaign in chandrapur fort. in this campaign lasting for 200 days, people performed task of cleaning fort, non-stop, without any fatigue and with team-work. they sent me photographs with a caption- 'before and after'! i was overwhelmed on seeing these\n  \n  * we shall celebrate the birth anniversary of sardar vallabhbhai patel ji on the 31st of october. he ensured that millions of indians were brought under the ambit of one nation & one constitution. 'run for unity' will be organised throughout the country on the day\n  "
In my previous article I showed how to do web scrapping, text mining and data visualization on Modi’s speech article of Times Of India on 29th October 2017.
Now we will do the final part of the process sentimental analysis.
To do Sentimental analysis we need a system to separate positive and negative words form the data. So, I have collected 2000 add frequent used words from English dictionary and separated based on positive and negative words.
Now let’s import the words and look at the words
pos.word<-readLines("C:/Users/Sangmesh/Google Drive/Big Data using R/Kaggle/pass_word.txt")
## Warning in readLines("C:/Users/Sangmesh/Google Drive/Big Data using R/
## Kaggle/pass_word.txt"): incomplete final line found on 'C:/Users/Sangmesh/
## Google Drive/Big Data using R/Kaggle/pass_word.txt'
Now lets match with our positive words and find how many are positive words are available in the dataset.
pos.tive<-sum(!is.na(match(textbag,pos.word)))
pos.tive
## [1] 24
Now we can see there are 24 positive words in the dataset we collected and processed
Now lets import negative words and have a look at the words
neg.word<-readLines("C:/Users/Sangmesh/Google Drive/Big Data using R/Kaggle/neg_word.txt")
## Warning in readLines("C:/Users/Sangmesh/Google Drive/Big Data using R/
## Kaggle/neg_word.txt"): incomplete final line found on 'C:/Users/Sangmesh/
## Google Drive/Big Data using R/Kaggle/neg_word.txt'
now lets find the negative words
neg.tive<-sum(!is.na(match(textbag,neg.word)))
neg.tive
## [1] 3
we found there are only 3 negative words in the data
now we will do score of this data.
pos.tive-neg.tive
## [1] 21
As per the data we have 21 positive words in the data set. it might be useless. so we will look at the overall data and find the percentage of positive and negative
(3/254)*100 #negative
## [1] 1.181102
In the overall data only 1.18% of the word is negative
(24/254)*100 #positive
## [1] 9.448819
out of 254 words only 9.44% of the words are positive.
In this analysis I had a check on positive and negative. similar analysis can be taken to find various other untapped sentiments like funny, sad, angry etc and narrow the research.
You can visit my previous articles to understand the coding process. The links are below:
https://experimentswithdatascience.blogspot.in/2017/08/text-analysis-easy-way-to-web-scrapping.html
https://experimentswithdatascience.blogspot.in/2017/10/modis-mann-ki-baat-text-analytics-text.html

No comments:

Post a Comment