Description Usage Arguments Value Examples
This function loads text and calculates score of each sentence on basis of presence of words of positive and negative sentiment supplied externally as paramater, presence of negation,and checking for sarcasm. 0 indicates neutral sentiment. Positive value indicates positive sentiment. Negative value indicates negative sentiment. 99 indicates sarcasm.
1 | calculate_custom_score(text, positivewords, negativewords, check = 0)
|
text |
A vector of sentences or a sentence (English). |
positivewords |
A vector of words of positive sentiment. |
negativewords |
A vector of words of negative sentiment. |
check |
A flag variable whose value if 1 denotes appending of passed positive and negative words with existing words.By default, this method will work with supplied positive and negative words only. |
A vector containing polarity of each sentence.
1 2 | calculate_custom_score("This is good",c("good"),c("bad"),1)
calculate_custom_score(c("This is good","This is bad"),c("good"),c("bad"),0)
|
[1] "Processing sentence: this is good"
1
1
[1] "Processing sentence: this is good"
[1] "Processing sentence: this is bad"
[1] 1 -1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.