sentiment.analysis package:none R Documentation Gives a sentiment score to a text that is the sum of the score of all scored words/expressions in the text. Description: sentiment.analysis receives a text and a table of words and their scores (if none is provided, the function will search for the "WordScores.txt" file provided with this function). Each word and expression of up to 4 words from the text is searched in the table data base and the scores of all words/expressions is added to get the text score. Usage: sentiment.analysis(your.text, word.list.and.scores) ## Default: sentiment.analysis(your.text, word.list.and.scores="WordScores.txt") Arguments: your.text: character. A text given by the user in UTF-8 encoding, in english language, usually a .txt file, but internet sites can also be given here. word.list.and.scores: table. A table with the words/ expressions in the fist column, and their score in the second column. The separator must be a tab ("\t") and their should be no header in the file. Value: The function returns the value of the text score (sum of all word/expression scores) and two graphics: one of the relative positive and negative words (in the universe of all categorized words) and one of the relative positive, negative and neutral words (in the universe of all words from the text, were un- categorized words are considered neutral). Warning: The function is not really fast, the bigger the text and you word list and score the more it will take. With the default word list even small texts may take a while to be processed. Remember that R demands quite a bit from your RAM memory, so it mey be a good ideia to make a camomile tea while you wait for the function to run, mainly if you are using large data. Also, in the case of low RAM memory and large texts there may appear a few warnings, but the program usually works out just fine. Just don't forget the camomile tea. Author: Júlia Beck Raíces nºUSP: 6802291 julia.raices@gmail.com juliar@riseup.net fingerprint: BF75 AF9A 1232 DFF6 0189 5D72 7877 3E81 1433 5F11 Thanks: Special thanks to Viviane Santos who helped me with the ideia of the function and with the references and to Chalom, who always helps me with the constant despair of computer programming. References: - The words list and scores was obtainned (and slightly modified) from: " Lars Kai Hansen, Adam Arvidsson, Finn Årup Nielsen, Elanor Colleoni, Michael Etter, "Good Friends, Bad News - Affect and Virality in Twitter", The 2011 International Workshop on Social Computing, Network, and Services (SocialComNet 2011). " - The "stoya.txt" test archive is the text "Sigh" from Stoya. Obtained from her blog at: http://graphicdescriptions.com/11-sigh See Also: - Bo Pang and Lillian Lee "Opinion Mining and Sentiment Analysis", Foundations and Trands on Information Retrieval, Vol 2 (2008). - SentiWordNet ( http://sentiwordnet.isti.cnr.it/ ) - Stanford's Sentiment Analysis website ( http://nlp.stanford.edu/sentiment/ ) Examples: # Download both the "WordScores.txt" file and the "stoya.txt" ## file at http://tinyurl.com/q353stg sentiment.analysis("stoya.txt", "WordScores.txt") # gives the text score and the graphs # Download both the files "WordScores.txt" and "test.txt" ##at http://tinyurl.com/q353stg sentiment analysis("test.txt") # gives the score and graphics for another text (in the case ## a made-up text of scored words). Notice that when ## word.list.and.scores is not given the function automatticaly ## uses the "WordScores.txt" file.