Skip to content

Commit

Permalink
review sentiment also working on the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
seekshreyas committed Jun 6, 2014
1 parent ae001fa commit 8aed348
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions obidroidMR.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
# import nltk
from textblob import TextBlob
from textblob.sentiments import NaiveBayesAnalyzer
# from textblob.sentiments import NaiveBayesAnalyzer
import sys
# import math

Expand Down Expand Up @@ -39,7 +39,7 @@ def getFeatures(rev):
revBlob = TextBlob(rev)
revPosTokens = revBlob.tags

for w, pos in revPosTokens:
for _, pos in revPosTokens:
if pos == 'JJ' or pos == 'VBP':
revAdjCount += 1

Expand All @@ -49,8 +49,8 @@ def getFeatures(rev):

# overall production sentiment classifier
# blob = TextBlob(rev, analyzer=NaiveBayesAnalyzer())
# blobSent = blob.sentiment

revSent = revBlob.sentiment.polarity
revSubjectivity = revBlob.sentiment.subjectivity


# print blobSent
Expand All @@ -63,7 +63,8 @@ def getFeatures(rev):
# revSent = 0


# revSent = round(revSent, 4)
revSent = round(revSent, 4)
revSubjectivity = round(revSubjectivity, 4)

return [
revCharLength,
Expand All @@ -72,7 +73,8 @@ def getFeatures(rev):
revCapCount,
revAdjCount,
# revSentAgg,
# revSent,
revSent,
revSubjectivity,
revExclaimCount
]

Expand Down

0 comments on commit 8aed348

Please sign in to comment.