lalital commited on
Commit
cf6195e
Β·
1 Parent(s): 574b23b

feat: update visualization

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -26,10 +26,10 @@ model = AutoModelForSequenceClassification.from_pretrained(
26
  )
27
  model.config.return_all_scores = True
28
  LABEL_MAPPING = {
29
- 'pos': 'πŸ€— Positive:',
30
- 'neu': '😐 Neutral:',
31
- 'neg': '😑 Negative:',
32
- 'q': 'πŸ€” Quesiton:',
33
  }
34
  CSS_PROGRESS_BAR_MAPPING = {
35
  'pos':'w3-green',
@@ -53,7 +53,7 @@ def render_html(items: List[Dict]):
53
 
54
  progress_bar_class_text = CSS_PROGRESS_BAR_MAPPING[label_id]
55
 
56
- html_text += f'<span>{label.replace(" ", "&nbsp;")}&nbsp;&nbsp;{(score*100):8.2f}%<span>' + \
57
  f'<div class="w3-light-grey w3-round"><div class="{progress_bar_class_text} w3-round" style="height:19px;width:{round(score*100,2)}%"></div></div><div style="height:8px;"></div>'
58
 
59
  return '<div class="w3-container">' + html_text + '</div>'
 
26
  )
27
  model.config.return_all_scores = True
28
  LABEL_MAPPING = {
29
+ 'pos': 'πŸ€— Positive',
30
+ 'neu': '😐 Neutral',
31
+ 'neg': '😑 Negative',
32
+ 'q': 'πŸ€” Quesiton',
33
  }
34
  CSS_PROGRESS_BAR_MAPPING = {
35
  'pos':'w3-green',
 
53
 
54
  progress_bar_class_text = CSS_PROGRESS_BAR_MAPPING[label_id]
55
 
56
+ html_text += f'<span>{label.replace(" ", "&nbsp;")}:&nbsp;&nbsp;{(score*100):8.2f}%<span>' + \
57
  f'<div class="w3-light-grey w3-round"><div class="{progress_bar_class_text} w3-round" style="height:19px;width:{round(score*100,2)}%"></div></div><div style="height:8px;"></div>'
58
 
59
  return '<div class="w3-container">' + html_text + '</div>'