akdeniz27 commited on
Commit
7ae6e02
1 Parent(s): edbb9d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -96,8 +96,8 @@ if Run_Button == True:
96
  else:
97
  spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity["entity"]})
98
 
99
- entity_list = ["PER", "LOC", "ORG", "MISC"]
100
- colors = {'PER': '#85DCDF', 'LOC': '#DF85DC', 'ORG': '#DCDF85', 'MISC': '#85ABDF',}
101
- html = spacy.displacy.render(spacy_display, style="ent", minify=True, manual=True, options={"ents": entity_list, "colors": colors})
102
  style = "<style>mark.entity { display: inline-block }</style>"
103
  st.write(f"{style}{get_html(html)}", unsafe_allow_html=True)
 
96
  else:
97
  spacy_display["ents"].append({"start": entity["start"], "end": entity["end"], "label": entity["entity"]})
98
 
99
+ entity_list = ["PER", "LOC", "ORG", "MISC", "person", "location", "geopolitical area", "organization", "event", "group", "date", "ordinal number", "cardinal", "ordinal", "product", "quantity", "time", "money", "percent", "language", "product"]
100
+ # colors = {'PER': '#85DCDF', 'LOC': '#DF85DC', 'ORG': '#DCDF85', 'MISC': '#85ABDF',}
101
+ html = spacy.displacy.render(spacy_display, style="ent", minify=True, manual=True, options={"ents": entity_list}) # , "colors": colors})
102
  style = "<style>mark.entity { display: inline-block }</style>"
103
  st.write(f"{style}{get_html(html)}", unsafe_allow_html=True)