KamelliaRe / GitHub-Project-Management

0 stars 0 forks source link

Sentiment analyzing #1

Open KamelliaRe opened 1 year ago

KamelliaRe commented 1 year ago

To calculate sentiment scores that take into account the importance of sentiments, we used a weighted sentiment analysis approach. We used the following steps to perform a weighted sentiment analysis: Choose a sentiment lexicon: A sentiment lexicon is a dictionary that contains words and phrases with their corresponding sentiment scores. Assign weights to sentiment scores: Assign weights to the sentiment scores based on their importance. For example, if you are analyzing customer reviews, a positive sentiment score in the review's title may be more important than a positive sentiment score in the body of the review. You can assign a weight of 2 to the sentiment score in the title and a weight of 1 to the sentiment score in the body. Tokenize and preprocess the text: Break the text into smaller units, such as words or phrases, and preprocess them by removing stopwords, stemming or lemmatizing, and normalizing the text. Calculate sentiment scores: For each unit of text, look up the sentiment score in the sentiment lexicon and multiply it by the weight assigned to that sentiment score. Sum the weighted sentiment scores for all units of text to obtain the overall sentiment score for the text. Normalize sentiment scores: Normalize the sentiment scores by dividing them by the sum of the weights assigned to the sentiment scores. This will give you a sentiment score that ranges from -1 to +1, where -1 represents extremely negative sentiment, +1 represents extremely positive sentiment, and 0 represents neutral sentiment. By using a weighted sentiment analysis approach, we calculated sentiment scores that take into account the importance of sentiments in the text. These sentiment scores can help you better understand the emotional tone or attitude expressed in the text and make more informed decisions based on that information.

We implemented the following code to perform sentiment analysis: https://github.com/haekalyulianto/Sentiment_Analysis

KamelliaRe commented 1 year ago

To calculate sentiment scores that take into account the importance of sentiments, we used a weighted sentiment analysis approach. We used the following steps to perform a weighted sentiment analysis: Choose a sentiment lexicon: A sentiment lexicon is a dictionary that contains words and phrases with their corresponding sentiment scores. Assign weights to sentiment scores: Assign weights to the sentiment scores based on their importance. For example, if you are analyzing customer reviews, a positive sentiment score in the review's title may be more important than a positive sentiment score in the body of the review. You can assign a weight of 2 to the sentiment score in the title and a weight of 1 to the sentiment score in the body. Tokenize and preprocess the text: Break the text into smaller units, such as words or phrases, and preprocess them by removing stopwords, stemming or lemmatizing, and normalizing the text. Calculate sentiment scores: For each unit of text, look up the sentiment score in the sentiment lexicon and multiply it by the weight assigned to that sentiment score. Sum the weighted sentiment scores for all units of text to obtain the overall sentiment score for the text. Normalize sentiment scores: Normalize the sentiment scores by dividing them by the sum of the weights assigned to the sentiment scores. This will give you a sentiment score that ranges from -1 to +1, where -1 represents extremely negative sentiment, +1 represents extremely positive sentiment, and 0 represents neutral sentiment. By using a weighted sentiment analysis approach, we calculated sentiment scores that take into account the importance of sentiments in the text. These sentiment scores can help you better understand the emotional tone or attitude expressed in the text and make more informed decisions based on that information.

We implemented the following code to perform sentiment analysis: https://github.com/haekalyulianto/Sentiment_Analysis