Title: | Analyse Sentiment of English Sentences |
---|---|
Description: | Analyses sentiment of a sentence in English and assigns score to it. It can classify sentences to the following categories of sentiments:- Positive, Negative, very Positive, very negative, Neutral. For a vector of sentences, it counts the number of sentences in each category of sentiment.In calculating the score, negation and various degrees of adjectives are taken into consideration. It deals only with English sentences. |
Authors: | Subhasree Bose <[email protected]> with contributons from Saptarsi Goswami. |
Maintainer: | Subhasree Bose <[email protected]> |
License: | GPL-2 |
Version: | 2.2.2 |
Built: | 2024-12-16 06:49:43 UTC |
Source: | CRAN |
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.
calculate_custom_score(text, positivewords, negativewords, check = 0)
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.
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)
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)
This function loads text and words of positive and negative sentiment supplied externally as paramater and calculates sentiment of each sentence. It classifies sentences into 6 categories: Positive, Negative, Very Positive, Very Negative Sarcasm and Neutral.
calculate_custom_sentiment(text, positivewords, negativewords, check = 0)
calculate_custom_sentiment(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 sentiment of each sentence.
calculate_custom_sentiment("This is good",c("good"),c("bad"),1) calculate_custom_sentiment(c("This is good","This is bad"),c("good"),c("bad"),0)
calculate_custom_sentiment("This is good",c("good"),c("bad"),1) calculate_custom_sentiment(c("This is good","This is bad"),c("good"),c("bad"),0)
This function loads text and words of positive and negative sentiment supplied externally as paramater, and calculates number of sentences which are positive, negative, very positive, very negative, neutral and sarcasm.
calculate_custom_total_presence_sentiment(text, positivewords, negativewords, check = 0)
calculate_custom_total_presence_sentiment(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 2-D matrix with two rows and 6 columns where first row contains the name of sentiment category and the second row contains the number in each category in string format.
calculate_custom_total_presence_sentiment(c("This is good","This is bad"),c("good"),c("bad"),0)
calculate_custom_total_presence_sentiment(c("This is good","This is bad"),c("good"),c("bad"),0)
This function loads text and calculates score of each sentence on basis of presence of words of positive and negative sentiment, presence of negation, and checking for sarcasm. 0 indicates neutral sentiment. Positive value indicates positive sentiment. Negative value indicates negative sentiment. 99 indicates sarcasm.
calculate_score(text)
calculate_score(text)
text |
A vector of sentences or a sentence (English). |
A vector containing polarity of each sentence.
calculate_score("This is good") calculate_score(c("This is good","This is bad"))
calculate_score("This is good") calculate_score(c("This is good","This is bad"))
This function loads text and calculates sentiment of each sentence. It classifies sentences into 6 categories: Positive, Negative, Very Positive, Very Negative Sarcasm and Neutral.
calculate_sentiment(text)
calculate_sentiment(text)
text |
A vector of sentences or a sentence (English). |
A vector containing sentiment of each sentence.
calculate_sentiment("This is good") calculate_sentiment(c("This is good","This is bad"))
calculate_sentiment("This is good") calculate_sentiment(c("This is good","This is bad"))
This function loads text and calculates number of sentences which are positive, negative, very positive, very negative, neutral and sarcasm.
calculate_total_presence_sentiment(text)
calculate_total_presence_sentiment(text)
text |
A vector of sentences or a sentence (English). |
A 2-D matrix with two rows and 6 columns where first row contains the name of sentiment category and the second row contains the number in each category in string format.
calculate_total_presence_sentiment(c("This is good","This is bad"))
calculate_total_presence_sentiment(c("This is good","This is bad"))