Stefan Dumitrescu commited on
Commit
543d322
·
1 Parent(s): 766d339
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,7 +23,7 @@ st.sidebar.write("")
23
 
24
 
25
  st.sidebar.header("Select type of PERSON detection")
26
- named_persons_only = st.sidebar.radio("", ('Proper nouns only', 'All nouns'))
27
 
28
  st.sidebar.write("Types of entities detected: 'PERSON', 'ORG', 'GPE', 'LOC', 'NAT_REL_POL', 'EVENT', 'LANGUAGE', 'WORK_OF_ART', 'DATETIME', 'PERIOD', 'MONEY', 'QUANTITY', 'NUMERIC', 'ORDINAL', 'FACILITY'")
29
 
@@ -39,7 +39,7 @@ elif input_method == "Write or Paste New Text":
39
 
40
  @st.cache(allow_output_mutation=True)
41
  def setModel(named_persons_only):
42
- ner = roner.NER(named_persons_only=True if named_persons_only.startswith("Proper") else False)
43
  return ner
44
 
45
  @st.cache(allow_output_mutation=True)
@@ -51,7 +51,7 @@ def get_html(html: str):
51
  Run_Button = st.button("Run", key=None)
52
  if Run_Button == True:
53
 
54
- ner = setModel(named_persons_only = False)
55
  output = ner(input_text)[0] # only one sentence
56
 
57
  # tabular form
 
23
 
24
 
25
  st.sidebar.header("Select type of PERSON detection")
26
+ named_persons_only_radio = st.sidebar.radio("", ('Proper nouns only', 'All nouns'))
27
 
28
  st.sidebar.write("Types of entities detected: 'PERSON', 'ORG', 'GPE', 'LOC', 'NAT_REL_POL', 'EVENT', 'LANGUAGE', 'WORK_OF_ART', 'DATETIME', 'PERIOD', 'MONEY', 'QUANTITY', 'NUMERIC', 'ORDINAL', 'FACILITY'")
29
 
 
39
 
40
  @st.cache(allow_output_mutation=True)
41
  def setModel(named_persons_only):
42
+ ner = roner.NER(named_persons_only=named_persons_only)
43
  return ner
44
 
45
  @st.cache(allow_output_mutation=True)
 
51
  Run_Button = st.button("Run", key=None)
52
  if Run_Button == True:
53
 
54
+ ner = setModel(named_persons_only = True if named_persons_only_radio.startswith("Proper") else False)
55
  output = ner(input_text)[0] # only one sentence
56
 
57
  # tabular form