Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ model_list = ['akdeniz27/bert-base-turkish-cased-ner',
|
|
| 20 |
'akdeniz27/convbert-base-turkish-cased-ner',
|
| 21 |
'akdeniz27/xlm-roberta-base-turkish-ner',
|
| 22 |
'xlm-roberta-large-finetuned-conll03-english',
|
| 23 |
-
'
|
| 24 |
|
| 25 |
st.sidebar.header("Select NER Model")
|
| 26 |
model_checkpoint = st.sidebar.radio("", model_list)
|
|
@@ -30,7 +30,7 @@ st.sidebar.write("")
|
|
| 30 |
|
| 31 |
if model_checkpoint == "akdeniz27/xlm-roberta-base-turkish-ner":
|
| 32 |
aggregation = "simple"
|
| 33 |
-
elif model_checkpoint == "xlm-roberta-large-finetuned-conll03-english" or model_checkpoint == "
|
| 34 |
aggregation = "simple"
|
| 35 |
st.sidebar.write("")
|
| 36 |
st.sidebar.write("The selected NER model is included just to show the zero-shot transfer learning capability of XLM-Roberta pretrained language model.")
|
|
@@ -101,7 +101,7 @@ if Run_Button and input_text != "":
|
|
| 101 |
spacy_entity_list = ["PERSON", "NORP", "FAC", "ORG", "GPE", "LOC", "PRODUCT", "EVENT", "WORK_OF_ART", "LAW", "LANGUAGE", "DATE", "TIME", "PERCENT", "MONEY", "QUANTITY", "ORDINAL", "CARDINAL", "MISC"]
|
| 102 |
|
| 103 |
for ent in spacy_display["ents"]:
|
| 104 |
-
if model_checkpoint == "
|
| 105 |
ent["label"] = spacy_entity_list[tner_entity_list.index(ent["label"])]
|
| 106 |
else:
|
| 107 |
if ent["label"] == "PER": ent["label"] = "PERSON"
|
|
|
|
| 20 |
'akdeniz27/convbert-base-turkish-cased-ner',
|
| 21 |
'akdeniz27/xlm-roberta-base-turkish-ner',
|
| 22 |
'xlm-roberta-large-finetuned-conll03-english',
|
| 23 |
+
'asahi417/tner-xlm-roberta-base-ontonotes5']
|
| 24 |
|
| 25 |
st.sidebar.header("Select NER Model")
|
| 26 |
model_checkpoint = st.sidebar.radio("", model_list)
|
|
|
|
| 30 |
|
| 31 |
if model_checkpoint == "akdeniz27/xlm-roberta-base-turkish-ner":
|
| 32 |
aggregation = "simple"
|
| 33 |
+
elif model_checkpoint == "xlm-roberta-large-finetuned-conll03-english" or model_checkpoint == "asahi417/tner-xlm-roberta-base-ontonotes5":
|
| 34 |
aggregation = "simple"
|
| 35 |
st.sidebar.write("")
|
| 36 |
st.sidebar.write("The selected NER model is included just to show the zero-shot transfer learning capability of XLM-Roberta pretrained language model.")
|
|
|
|
| 101 |
spacy_entity_list = ["PERSON", "NORP", "FAC", "ORG", "GPE", "LOC", "PRODUCT", "EVENT", "WORK_OF_ART", "LAW", "LANGUAGE", "DATE", "TIME", "PERCENT", "MONEY", "QUANTITY", "ORDINAL", "CARDINAL", "MISC"]
|
| 102 |
|
| 103 |
for ent in spacy_display["ents"]:
|
| 104 |
+
if model_checkpoint == "asahi417/tner-xlm-roberta-base-ontonotes5":
|
| 105 |
ent["label"] = spacy_entity_list[tner_entity_list.index(ent["label"])]
|
| 106 |
else:
|
| 107 |
if ent["label"] == "PER": ent["label"] = "PERSON"
|