poltextlab commited on
Commit
6fdc6e2
·
verified ·
1 Parent(s): 5bdfb1c

hover effect

Browse files
Files changed (1) hide show
  1. interfaces/cap_minor.py +4 -1
interfaces/cap_minor.py CHANGED
@@ -108,7 +108,10 @@ def predict(text, model_id, tokenizer_id):
108
  html += f"""
109
  <div style="height: 4px; background-color: green; width: {bar_width}%; margin-bottom: 8px;"></div>
110
  <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
111
- <span style="color: {text_color};">{label} {int(prob * 100)}%</span>
 
 
 
112
  </div>
113
  """
114
  first = False
 
108
  html += f"""
109
  <div style="height: 4px; background-color: green; width: {bar_width}%; margin-bottom: 8px;"></div>
110
  <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
111
+ <span style="color: {text_color}; transition: background-color 0.3s, color 0.3s; padding: 2px;"
112
+ onmouseover="this.style.backgroundColor='orange'; this.style.color='white'"
113
+ onmouseout="this.style.backgroundColor='transparent'; this.style.color='{text_color}'"
114
+ ">{label} — {int(prob * 100)}%</span>
115
  </div>
116
  """
117
  first = False