Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ model_list = ['xlm-roberta-large-finetuned-conll03-english', 'xlm-roberta-large'
|
|
| 22 |
st.sidebar.header("Vocabulary categorizer")
|
| 23 |
model_checkpoint = st.sidebar.radio("", model_list)
|
| 24 |
|
| 25 |
-
st.sidebar.write("Which model highlights the most
|
| 26 |
st.sidebar.write("")
|
| 27 |
|
| 28 |
xlm_agg_strategy_info = "'aggregation_strategy' can be selected as 'simple' or 'none' for 'xlm-roberta'."
|
|
@@ -38,14 +38,14 @@ elif model_checkpoint == "xlm-roberta-large":
|
|
| 38 |
st.sidebar.write("")
|
| 39 |
|
| 40 |
st.subheader("Select Text Input Method")
|
| 41 |
-
input_method = st.radio("", ('Select from
|
| 42 |
if input_method == 'Select from Examples':
|
| 43 |
-
selected_text = st.selectbox('Select
|
| 44 |
st.subheader("Text to Run")
|
| 45 |
-
input_text = st.text_area("Selected
|
| 46 |
elif input_method == "Write or Paste New Text":
|
| 47 |
-
st.subheader("Text
|
| 48 |
-
input_text = st.text_area('Write or
|
| 49 |
|
| 50 |
@st.cache(allow_output_mutation=True)
|
| 51 |
def setModel(model_checkpoint, aggregation):
|
|
@@ -59,7 +59,7 @@ def get_html(html: str):
|
|
| 59 |
html = html.replace("\n", " ")
|
| 60 |
return WRAPPER.format(html)
|
| 61 |
|
| 62 |
-
Run_Button = st.button("
|
| 63 |
if Run_Button == True:
|
| 64 |
|
| 65 |
ner_pipeline = setModel(model_checkpoint, aggregation)
|
|
|
|
| 22 |
st.sidebar.header("Vocabulary categorizer")
|
| 23 |
model_checkpoint = st.sidebar.radio("", model_list)
|
| 24 |
|
| 25 |
+
st.sidebar.write("Which model highlights the most nouns? Which model highlights nouns the most accurately?")
|
| 26 |
st.sidebar.write("")
|
| 27 |
|
| 28 |
xlm_agg_strategy_info = "'aggregation_strategy' can be selected as 'simple' or 'none' for 'xlm-roberta'."
|
|
|
|
| 38 |
st.sidebar.write("")
|
| 39 |
|
| 40 |
st.subheader("Select Text Input Method")
|
| 41 |
+
input_method = st.radio("", ('Select from examples', 'Write or paste text'))
|
| 42 |
if input_method == 'Select from Examples':
|
| 43 |
+
selected_text = st.selectbox('Select example from list', example_list, index=0, key=1)
|
| 44 |
st.subheader("Text to Run")
|
| 45 |
+
input_text = st.text_area("Selected example", selected_text, height=128, max_chars=None, key=2)
|
| 46 |
elif input_method == "Write or Paste New Text":
|
| 47 |
+
st.subheader("Text Input")
|
| 48 |
+
input_text = st.text_area('Write or paste text below', value="", height=128, max_chars=None, key=2)
|
| 49 |
|
| 50 |
@st.cache(allow_output_mutation=True)
|
| 51 |
def setModel(model_checkpoint, aggregation):
|
|
|
|
| 59 |
html = html.replace("\n", " ")
|
| 60 |
return WRAPPER.format(html)
|
| 61 |
|
| 62 |
+
Run_Button = st.button("Submit", key=None)
|
| 63 |
if Run_Button == True:
|
| 64 |
|
| 65 |
ner_pipeline = setModel(model_checkpoint, aggregation)
|