Skip to content

Sentiment Analysis of a file (Script to know if your text's mood is Happy or Sad)

License

Notifications You must be signed in to change notification settings

puneetsl/HappyOrSad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HappyOrSad

Sentiment Analysis of a file (if text inside file contains happy or sad mood?) The same code is the working for determining your twitter mood at:
https://mytwitmood.tutafuta.com/

Requirements

perl

How to use

To run this perl script all you have to do is:

$perl happyorsad.pl <file name>

it would print output in following format:

This text is so Happy!
Happy: 82.56% :-)
Sad: 17.44% :-(

Dictionary taken from

Created my own dictionary for bigram analysis also used LIWC2007 dictionary from this source
https://code.google.com/p/negotiations-ling773/source/browse/trunk/resources/LIWC2007.dic?r=2

Added 3 poems

I have added 3 poems as test cases for showing the use and accuracy of the results.
Run using:
perl happyorsad.pl poem1.txt

Output:
This text is so Sad!
Happy: 16.79% :-)
Sad: 83.21% :-(

Cite me

In case you use this project please cite me using this citation:
Puneet Singh, et al. "Architecture for Automated Tagging and Clustering of Song Files According to Mood." International Journal of Computer Science Issues (IJCSI) 7.4 (2010).

References

Pennebaker, J.W., Chung, C.K., Ireland, M., Gonzales, A., & Booth, R.J. (2007). The development and psychometric properties of LIWC2007. [Software manual]. Austin, TX (www.liwc.net)

About

Sentiment Analysis of a file (Script to know if your text's mood is Happy or Sad)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages