nanom commited on
Commit
2987782
1 Parent(s): 389387c

Fixed bug in frontend when ordering list of PLL scores in module_customPllLabel.py

Browse files
Files changed (1) hide show
  1. modules/module_customPllLabel.py +7 -6
modules/module_customPllLabel.py CHANGED
@@ -98,13 +98,14 @@ class CustomPllLabel:
98
  pll_dict: Dict[str, float]
99
  ) -> str:
100
 
101
- sorted_pll_dict = dict(sorted(pll_dict.items(), key=lambda x: x[1], reverse=True))
102
-
103
- sents = list(sorted_pll_dict.keys())
 
 
104
  # Scape < and > marks from hightlight word/s
105
- sents = [s.replace("<","&#60;").replace(">","&#62;")for s in sents]
106
 
107
- scores = list(sorted_pll_dict.values())
108
  ratios = self.__getProportions(scores)
109
-
110
  return self.__render(sents, scores, ratios)
 
98
  pll_dict: Dict[str, float]
99
  ) -> str:
100
 
101
+ sorted_pll_dict = sorted(pll_dict.items(), key=lambda x: x[1], reverse=True)
102
+
103
+ sents = [k for k,_ in sorted_pll_dict]
104
+ scores = [v for _,v in sorted_pll_dict]
105
+
106
  # Scape < and > marks from hightlight word/s
107
+ sents = [s.replace("<","&#60;").replace(">","&#62;") for s in sents]
108
 
 
109
  ratios = self.__getProportions(scores)
110
+
111
  return self.__render(sents, scores, ratios)