Beispiel #1
0
 def __init__(self, configFilepath=None):
     #configFilepath = r"C:\Users\ashvin\Desktop\UnderDevelopment\sentimentConfig.csv"
     df = pd.read_csv(configFilepath)
     df.set_index('Parameters', inplace=True)
     reviews = df.loc['paths', 'Value'].split(',')
     catNum = df.loc['numOfCat', 'Value']
     catTypes = df.loc['catType', 'Value'].split(',')
     sentimentLabel = df.loc['train', 'Value']
     sentiment = sa.SentimentTrain()
     acc, allReviews = sentiment.extract(reviews, catNum, catTypes,
                                         sentimentLabel)
     visuals = Visualisation(df=None, target=None)
     visuals.wordCloud(allReviews)
Beispiel #2
0
 def __init__(self, df=None):
     #configFilepath = r"C:\Users\ashvin\Desktop\UnderDevelopment\sentimentConfig.csv"
     #df = pd.read_csv(configFilepath)
     #df.set_index('Parameters', inplace = True)
     print('creating Results directory--------> at {}'.format(os.getcwd()))
     try:
         os.makedirs('results')
     except:
         pass
     reviews = df.loc['paths', 'Value'].split(',')
     catNum = df.loc['numOfCat', 'Value']
     catTypes = df.loc['catType', 'Value'].split(',')
     sentimentLabel = df.loc['train', 'Value']
     sentiment = sa.SentimentTrain()
     acc, allReviews = sentiment.extract(reviews, catNum, catTypes,
                                         sentimentLabel)
     visuals = Visualisation(df=None, target=None)
     visuals.wordCloud(allReviews)