Spaces:
Runtime error
Runtime error
some cleaning
Browse files
app.py
CHANGED
@@ -150,7 +150,6 @@ def load_ner():
|
|
150 |
:returns: loaded fr_arches model
|
151 |
:rtype: spacy.lang.fr.French
|
152 |
"""
|
153 |
-
|
154 |
ner = spacy.load("fr_arches")
|
155 |
# To try to reduce memory usage
|
156 |
config = {"attrs": {"tensor": None}}
|
@@ -674,7 +673,13 @@ def main():
|
|
674 |
# ===== MODE: XML EXPORT =====
|
675 |
if choix_xml == "Conserver les balises (export xml de l'intégralité* du fichier importé)":
|
676 |
|
677 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
678 |
st.write("")
|
679 |
|
680 |
# Upload an xml file
|
@@ -701,10 +706,8 @@ def main():
|
|
701 |
modified_xml = html.unescape(modified_xml)
|
702 |
|
703 |
st.write("")
|
704 |
-
|
705 |
-
|
706 |
-
st.markdown(
|
707 |
-
"**Les entités ont été converties comme suit : (en construction)** \n\n- **CHRONOLOGIE :** ```<date>``` \n- **MOBILIER :** ```<objectType>``` \n- **STRUCTURE :** ```<name type=\"structure\">``` \n- **MATERIAU :** ```<material>``` \n- **ID :** ```<idno type=\"entite\">``` \n- **TECHNIQUE_STYLE :** ```<name type=\"technique_style\">``` \n- **DECOR :** ```<name type=\"decor\">``` \n- **ESPECE :** ```<name type=\"espece\">``` \n- **EDIFICE :** ```<placeName type=\"edifice\">``` \n- **PEUPLE_CULTURE :** ```<orgName type=\"peuple_culture\">``` \n- **PERSONNE :** ```<persName>``` \n- **ORG :** ```<orgName>``` \n- **GPE :** ```<placeName>``` \n- **LOC :** ```<geogName>``` \n- **LIEUDIT_SITE :** ```<placeName type=\"lieudit_site\">```")
|
708 |
st.write("")
|
709 |
|
710 |
# Display the modified XML
|
@@ -720,6 +723,8 @@ def main():
|
|
720 |
):
|
721 |
st.code(modified_xml, language="xml")
|
722 |
|
|
|
|
|
723 |
# Download the modified XML
|
724 |
# We add a "_entites" at the end of the file name to differentiate it from the original
|
725 |
st.download_button(
|
|
|
150 |
:returns: loaded fr_arches model
|
151 |
:rtype: spacy.lang.fr.French
|
152 |
"""
|
|
|
153 |
ner = spacy.load("fr_arches")
|
154 |
# To try to reduce memory usage
|
155 |
config = {"attrs": {"tensor": None}}
|
|
|
673 |
# ===== MODE: XML EXPORT =====
|
674 |
if choix_xml == "Conserver les balises (export xml de l'intégralité* du fichier importé)":
|
675 |
|
676 |
+
st.write("")
|
677 |
+
st.error("\* À l'exception des balises <hi> du body.")
|
678 |
+
st.write("")
|
679 |
+
with st.expander("Au sujet du mapping XML des entités nommées"):
|
680 |
+
st.markdown(
|
681 |
+
"**Les entités nommées ont été converties comme suit :** \n\n- **CHRONOLOGIE :** ```<date>``` \n- **MOBILIER :** ```<objectType>``` \n- **STRUCTURE :** ```<name type=\"structure\">``` \n- **MATERIAU :** ```<material>``` \n- **ID :** ```<idno type=\"entite\">``` \n- **TECHNIQUE_STYLE :** ```<name type=\"technique_style\">``` \n- **DECOR :** ```<name type=\"decor\">``` \n- **ESPECE :** ```<name type=\"espece\">``` \n- **EDIFICE :** ```<placeName type=\"edifice\">``` \n- **PEUPLE_CULTURE :** ```<orgName type=\"peuple_culture\">``` \n- **PERSONNE :** ```<persName>``` \n- **ORG :** ```<orgName>``` \n- **GPE :** ```<placeName>``` \n- **LOC :** ```<geogName>``` \n- **LIEUDIT_SITE :** ```<placeName type=\"lieudit_site\">```")
|
682 |
+
st.write("")
|
683 |
st.write("")
|
684 |
|
685 |
# Upload an xml file
|
|
|
706 |
modified_xml = html.unescape(modified_xml)
|
707 |
|
708 |
st.write("")
|
709 |
+
st.subheader("Résultats :")
|
710 |
+
st.write("")
|
|
|
|
|
711 |
st.write("")
|
712 |
|
713 |
# Display the modified XML
|
|
|
723 |
):
|
724 |
st.code(modified_xml, language="xml")
|
725 |
|
726 |
+
st.write("")
|
727 |
+
|
728 |
# Download the modified XML
|
729 |
# We add a "_entites" at the end of the file name to differentiate it from the original
|
730 |
st.download_button(
|