avichr commited on
Commit
c8c9e7c
·
1 Parent(s): ce897fa

Update HebEMO.py

Browse files
Files changed (1) hide show
  1. HebEMO.py +5 -2
HebEMO.py CHANGED
@@ -24,7 +24,9 @@ class HebEMO:
24
  input_path(str): the path to the text file (txt file, each row for different instance)
25
  returns pandas DataFrame of the analyzed texts and save it to the same dir of the input file
26
  '''
27
- from pyplutchik import plutchik
 
 
28
  import matplotlib.pyplot as plt
29
  import pandas as pd
30
  import time
@@ -75,7 +77,8 @@ class HebEMO:
75
  hebEMO[emo] = abs(hebEMO_df[emo]-(1-hebEMO_df['confidence_'+emo]))
76
 
77
  for i in range(0,1):
78
- ax = plutchik(hebEMO.to_dict(orient='records')[i])
 
79
  print(hebEMO_df[0][i])
80
  plt.show()
81
  return (plt.figure())
 
24
  input_path(str): the path to the text file (txt file, each row for different instance)
25
  returns pandas DataFrame of the analyzed texts and save it to the same dir of the input file
26
  '''
27
+ try: from pyplutchik import plutchik
28
+ except: from spider_plot import spider_plot
29
+
30
  import matplotlib.pyplot as plt
31
  import pandas as pd
32
  import time
 
77
  hebEMO[emo] = abs(hebEMO_df[emo]-(1-hebEMO_df['confidence_'+emo]))
78
 
79
  for i in range(0,1):
80
+ try: ax = plutchik(hebEMO.to_dict(orient='records')[i])
81
+ except: ax = spider_plot(hebEMO)
82
  print(hebEMO_df[0][i])
83
  plt.show()
84
  return (plt.figure())