Spaces:
Sleeping
Sleeping
Ilyas KHIAT
commited on
Commit
·
c408d8a
1
Parent(s):
bc557f4
more details content
Browse files
app.py
CHANGED
|
@@ -182,28 +182,28 @@ def main():
|
|
| 182 |
|
| 183 |
st.code(well_formatted_audit)
|
| 184 |
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
#global audit
|
| 193 |
-
audit_simplified = {
|
| 194 |
-
"Nombre de pages": audit["number_of_paragraphs"],
|
| 195 |
-
"Nombre d'images": audit["number_of_images"],
|
| 196 |
-
"Nombre de liens": audit["number_of_links"],
|
| 197 |
-
"Nombre de tableaux": audit["number_of_tables"],
|
| 198 |
-
"Nombre de tokens": audit["number_of_tokens"],
|
| 199 |
-
"Nombre de mots": audit["number_of_words"]
|
| 200 |
-
}
|
| 201 |
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
-
|
| 207 |
|
| 208 |
|
| 209 |
if __name__ == "__main__":
|
|
|
|
| 182 |
|
| 183 |
st.code(well_formatted_audit)
|
| 184 |
|
| 185 |
+
elif type == "word":
|
| 186 |
+
if st.session_state.name_file != uploaded_file.name:
|
| 187 |
+
st.session_state.name_file = uploaded_file.name
|
| 188 |
+
with st.spinner("Analyse du document..."):
|
| 189 |
+
st.session_state.audit = audit_descriptif_word(uploaded_file)
|
| 190 |
+
audit = st.session_state.audit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
+
#global audit
|
| 193 |
+
audit_simplified = {
|
| 194 |
+
"Nombre de pages": audit["number_of_paragraphs"],
|
| 195 |
+
"Nombre d'images": audit["number_of_images"],
|
| 196 |
+
"Nombre de liens": audit["number_of_links"],
|
| 197 |
+
"Nombre de tableaux": audit["number_of_tables"],
|
| 198 |
+
"Nombre de tokens": audit["number_of_tokens"],
|
| 199 |
+
"Nombre de mots": audit["number_of_words"]
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
well_formatted_audit = "Contenus audités\n"
|
| 203 |
+
for key, value in audit_simplified.items():
|
| 204 |
+
well_formatted_audit += f"- {key}: {value}\n"
|
| 205 |
|
| 206 |
+
st.code(well_formatted_audit)
|
| 207 |
|
| 208 |
|
| 209 |
if __name__ == "__main__":
|