-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSentimentScoreAnalyzer.py
More file actions
34 lines (27 loc) · 1.22 KB
/
Copy pathSentimentScoreAnalyzer.py
File metadata and controls
34 lines (27 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import json
import matplotlib
import nltk
import pprint
import numpy
# INCOMPLETE, WORK-IN-PROGRESS!!
# The analyzeSIAScore class will be used to build different interpretations from the sentiment analysis scores that each story receives.
'''TODO:
generate dispersion graph using matplotlib
generate Naive Bayes classification
find score distribution for negative, neutral, and positive, and then compare these distributions to raw content, cleaned content with stopwords, and cleaned content without stopwords.
'''
class analyzeSIAScore:
def __init__(self, filePath):
self.filePath = filePath
self.collectRawScores = {}
self.collectCleanedWithStopwordsScores = {}
self.collectCleanedWithoutStopwordsScores = {}
#collectScores will find all the respective scores for the three instance variables as dictionaries above.
def collectScores(self, scoresheet):
#dispersionGraph will use matplotlib to graph word dispersion graph
def dispersionGraph(self, words):
#scoreDistributionGraph will graph the score distribution across all stories.
def scoreDistributionGraph(self, ):
if __name__ == "__main__":
jsonPath = "SentimentScore.json"
analyzer = analyzeSIAScore(jsonPath)