Johannes commited on
Commit
a5bc7b6
1 Parent(s): 733a1a0

color update

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -26,9 +26,14 @@ def infer(input_text):
26
  }
27
  displacy_ents.append(displacy_ent_dict)
28
 
 
 
 
 
 
29
  displacy_dict_template = {"text": input_text, "ents": displacy_ents, "title": None}
30
 
31
- html = displacy.render(displacy_dict_template, style="ent", page=True, manual=True)
32
 
33
  html = (
34
  ""
 
26
  }
27
  displacy_ents.append(displacy_ent_dict)
28
 
29
+ colors = {"B-ENG": "linear-gradient(90deg, #aa9cfc, #fc9ce7)",
30
+ "I-ENG": "linear-gradient(90deg, #99bfff, #a57cf0)",
31
+ "OTHER": "linear-gradient(90deg, #79d0a5, #f6e395)"}
32
+
33
+ options = {"ents": ["B-ENG", "I-ENG", "OTHER"], "colors": colors}
34
  displacy_dict_template = {"text": input_text, "ents": displacy_ents, "title": None}
35
 
36
+ html = displacy.render(displacy_dict_template, style="ent", page=True, manual=True, options=options)
37
 
38
  html = (
39
  ""