Ich habe versucht, here ein zusammenhängenden Sentiment-Analyse-Paket neu zu organisieren und bereitzustellen. SentR umfasst die Wortstamm- und Vorverarbeitung und bietet Zugriff auf die ViralHeat-API, eine Standardaggregationsfunktion sowie eine weiterentwickelte Naive-Bayes-Methode.
Installation ist relativ einfach:
install.packages('devtools')
require('devtools')
install_github('mananshah99/sentR')
require('sentR')
Und eine einfache Klassifizierung Beispiel:
# Create small vectors for happy and sad words (useful in aggregate(...) function)
positive <- c('happy', 'well-off', 'good', 'happiness')
negative <- c('sad', 'bad', 'miserable', 'terrible')
# Words to test sentiment
test <- c('I am a very happy person.', 'I am a very sad person',
'I’ve always understood happiness to be appreciation. There is no greater happiness than appreciation for what one has- both physically and in the way of relationships and ideologies. The unhappy seek that which they do not have and can not fully appreciate the things around them. I don’t expect much from life. I don’t need a high paying job, a big house or fancy cars. I simply wish to be able to live my life appreciating everything around me.
')
# 1. Simple Summation
out <- classify.aggregate(test, positive, negative)
out
# 2. Naive Bayes
out <- classify.naivebayes(test)
out
, die die folgende Ausgabe liefert:
score
1 1
2 -1
3 2
POS NEG POS/NEG SENT
[1,] "9.47547003995745" "0.445453222112551" "21.2715265477714" "positive"
[2,] "1.03127774142571" "9.47547003995745" "0.108836578774127" "negative"
[3,] "67.1985217685598" "35.1792261323723" "1.9101762362738" "positive"
Bitte fühlen Sie sich frei zu tragen :) Hoffnung das hilft!
Check-out Jeffery Breen Arbeit hier: http: //www.slideshare.net/jeffreybreen/r-by-example-mining-twitter-für – mweylandt
@mweylandt, wie ein Kerl Jeffrey selbst, es ist "r-e-y." Aber es scheint wie eine einfache, saubere Methode. –
Jeffrey Breen bietet vor allem Anfängern in Text Mining eine hervorragende Anleitung wie ich. Ich bewerbe mich, den von Paras geteilten Link zu besuchen. Von diesem Link können Sie Professor Bing Liu Website gehen, die auf das Thema spezialisiert ist: [Meinung Mining, Sentiment Analysis und Stellungnahme Spam-Erkennung] [1] [1]: http: //www.cs.uic. edu/~ liub/FBS/sentiment-analysis.html Grüße, Rod – rodobastias