marcossuzuki commited on
Commit
532aab1
·
verified ·
1 Parent(s): acf89de

using portuguese terms

Browse files
Files changed (1) hide show
  1. src/datashap/DataSHAP.py +5 -3
src/datashap/DataSHAP.py CHANGED
@@ -83,15 +83,17 @@ class DataSHAP:
83
 
84
  def get_statistic(self, df)->DataFrame:
85
  statistic = DataFrame()
86
- statistic['positive_score'] = df[df['tag']=='POSITIVE']['score'].describe()
87
- statistic['negative_score'] = df[df['tag']=='NEGATIVE']['score'].describe()
88
- statistic['neutral_score'] = df[df['tag']=='NEUTRAL']['score'].describe()
89
  return statistic
90
 
91
  def get_performance(self):
92
  return self.total_tokens, self.h, self.m, self.s
93
 
94
  def three_plot(self, df):
 
 
95
  fig = make_subplots(rows=2, cols=2, horizontal_spacing = 0.0, vertical_spacing = 0.05,
96
  shared_xaxes=True, shared_yaxes=True,
97
  row_heights=[0.4, 0.6], column_widths=[0.8, 0.2])
 
83
 
84
  def get_statistic(self, df)->DataFrame:
85
  statistic = DataFrame()
86
+ statistic['Score Positivo'] = df[df['tag']=='POSITIVE']['score'].describe()
87
+ statistic['Score Negativo'] = df[df['tag']=='NEGATIVE']['score'].describe()
88
+ statistic['Score Neutro'] = df[df['tag']=='NEUTRAL']['score'].describe()
89
  return statistic
90
 
91
  def get_performance(self):
92
  return self.total_tokens, self.h, self.m, self.s
93
 
94
  def three_plot(self, df):
95
+ df['tag'] = df['tag'].replace({'POSITIVE': 'Positivo', 'NEGATIVE': 'Negativo', 'NEUTRAL': 'Neutro'})
96
+ df = df.rename(columns={'tag': 'rotulo'})
97
  fig = make_subplots(rows=2, cols=2, horizontal_spacing = 0.0, vertical_spacing = 0.05,
98
  shared_xaxes=True, shared_yaxes=True,
99
  row_heights=[0.4, 0.6], column_widths=[0.8, 0.2])