Fixed error
This commit is contained in:
@@ -7,7 +7,7 @@ from os import getcwd
|
|||||||
|
|
||||||
class PySentiStr:
|
class PySentiStr:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
# self.SentiStrengthLocation = os.path.join(getcwd(),"SentiStrength.jar")
|
# self.SentiStrengthLocation = os.path.join(getcwd(),"SentiStrength.jar")
|
||||||
# self.SentiStrengthLanguageFolder = os.path.join(getcwd(),"SentiStrengthData/")
|
# self.SentiStrengthLanguageFolder = os.path.join(getcwd(),"SentiStrengthData/")
|
||||||
|
|
||||||
@@ -19,12 +19,12 @@ class PySentiStr:
|
|||||||
self.SentiStrengthLanguageFolder = sslf_Path
|
self.SentiStrengthLanguageFolder = sslf_Path
|
||||||
|
|
||||||
def getSentiment(self, df_text, score='scale'):
|
def getSentiment(self, df_text, score='scale'):
|
||||||
if not hasattr(self, 'SentiStrengthLocation'):
|
if not hasattr(self, 'SentiStrengthLocation'):
|
||||||
print("Set path using setSentiStrengthPath(path) function.")
|
assert False, "Set path using setSentiStrengthPath(path) function."
|
||||||
if not hasattr(self, 'SentiStrengthLanguageFolder'):
|
|
||||||
print("Set path using setSentiStrengthLanguageFolderPath(path) function.")
|
if not hasattr(self, 'SentiStrengthLanguageFolder'):
|
||||||
|
assert False, "Set path using setSentiStrengthLanguageFolderPath(path) function."
|
||||||
|
|
||||||
# Able to take in single string or list of string and convert into pandas Series
|
|
||||||
if type(df_text) != pd.Series:
|
if type(df_text) != pd.Series:
|
||||||
df_text = pd.Series(df_text)
|
df_text = pd.Series(df_text)
|
||||||
df_text = df_text.str.replace('\n','')
|
df_text = df_text.str.replace('\n','')
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="sentistrength",
|
name="sentistrength",
|
||||||
version="0.0.1",
|
version="0.0.3",
|
||||||
author="Zhun Hung",
|
author="Zhun Hung",
|
||||||
author_email="yongzhunhung@gmail.com",
|
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.",
|
description="Python 3 Wrapper for SentiStrength, reads a single or multiple input with options for binary class or scale output.",
|
||||||
|
|||||||
Reference in New Issue
Block a user