Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import requests
|
| 2 |
import os
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
import pandas as pd
|
| 5 |
import numpy as np
|
|
@@ -80,15 +81,16 @@ st.markdown("## 1. Analyse des données textuelles")
|
|
| 80 |
col1, col2 = st.columns(2)
|
| 81 |
|
| 82 |
with col1:
|
| 83 |
-
st.markdown("###
|
| 84 |
text_lengths = X.apply(lambda x: len(x.split()))
|
| 85 |
df_lengths = pd.DataFrame({'length': text_lengths})
|
| 86 |
fig = px.histogram(df_lengths, x='length', nbins=30, title="Distribution de la longueur des questions")
|
| 87 |
st.plotly_chart(fig, use_container_width=True)
|
| 88 |
|
| 89 |
with col2:
|
| 90 |
-
|
| 91 |
-
|
|
|
|
| 92 |
tag_freq = Counter(all_tags)
|
| 93 |
most_common_tags = pd.DataFrame(
|
| 94 |
tag_freq.most_common(20), columns=['Tag', 'Nombre'])
|
|
|
|
| 1 |
import requests
|
| 2 |
import os
|
| 3 |
+
import ast
|
| 4 |
import streamlit as st
|
| 5 |
import pandas as pd
|
| 6 |
import numpy as np
|
|
|
|
| 81 |
col1, col2 = st.columns(2)
|
| 82 |
|
| 83 |
with col1:
|
| 84 |
+
st.markdown("### Questions")
|
| 85 |
text_lengths = X.apply(lambda x: len(x.split()))
|
| 86 |
df_lengths = pd.DataFrame({'length': text_lengths})
|
| 87 |
fig = px.histogram(df_lengths, x='length', nbins=30, title="Distribution de la longueur des questions")
|
| 88 |
st.plotly_chart(fig, use_container_width=True)
|
| 89 |
|
| 90 |
with col2:
|
| 91 |
+
st.markdown("### Tags")
|
| 92 |
+
parsed_tags = Y.apply(ast.literal_eval)
|
| 93 |
+
all_tags = [tag for sublist in parsed_tags for tag in sublist]
|
| 94 |
tag_freq = Counter(all_tags)
|
| 95 |
most_common_tags = pd.DataFrame(
|
| 96 |
tag_freq.most_common(20), columns=['Tag', 'Nombre'])
|