Remove normalization for scale

This commit is contained in:
zhunhung
2020-04-07 20:37:21 +08:00
parent 79711e60cc
commit f8e8adff48
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -41,8 +41,8 @@ class PySentiStr:
senti_score = list(map(float, senti_score))
senti_score = [int(i) for i in senti_score]
if score == 'scale': # Returns from -1 to 1
senti_score = [sum(senti_score[i:i+2])/4 for i in range(0, len(senti_score), 3)]
if score == 'scale': # Returns from -4 to 4
senti_score = [sum(senti_score[i:i+2]) for i in range(0, len(senti_score), 3)]
elif score == 'binary': # Return 1 if positive and -1 if negative
senti_score = [1 if senti_score[i] >= abs(senti_score[i+1]) else -1 for i in range(0, len(senti_score), 3)]
elif score == 'trinary': # Return Positive and Negative Score and Neutral Score
+1 -1
View File
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="sentistrength",
version="0.0.5",
version="0.0.8",
author="Zhun Hung",
author_email="yongzhunhung@gmail.com",
description="Python 3 Wrapper for SentiStrength, reads a single or multiple input with options for binary class or scale output.",