kleinay commited on
Commit
d3a7a20
β€’
1 Parent(s): 1637d4b

change colors

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -44,8 +44,8 @@ def call(sentence, detection_threshold):
44
  qasrl_predicates = [pred_info['predicate_idx'] for pred_info in outputs['qasrl']]
45
  qanom_predicates = [pred_info['predicate_idx'] for pred_info in outputs['qanom']]
46
  def color(idx):
47
- if idx in qasrl_predicates : return "purple"
48
- if idx in qanom_predicates : return "blue"
49
  def word_span(word, idx):
50
  return f'<span style="background-color: {color(idx)}">{word}</span>'
51
  html = '<span>' + ' '.join(word_span(word, idx) for idx, word in enumerate(sentence.split(" "))) + '</span>'
 
44
  qasrl_predicates = [pred_info['predicate_idx'] for pred_info in outputs['qasrl']]
45
  qanom_predicates = [pred_info['predicate_idx'] for pred_info in outputs['qanom']]
46
  def color(idx):
47
+ if idx in qasrl_predicates : return "aquamarine"
48
+ if idx in qanom_predicates : return "aqua"
49
  def word_span(word, idx):
50
  return f'<span style="background-color: {color(idx)}">{word}</span>'
51
  html = '<span>' + ' '.join(word_span(word, idx) for idx, word in enumerate(sentence.split(" "))) + '</span>'