Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,6 +147,36 @@ def analyze_text(text):
|
|
147 |
return nb_mots, polarite, subjectivite, mots_cles, resume1, resume2
|
148 |
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
st.title('Text Analysis and Summary')
|
151 |
text = st.text_area('Enter text here:')
|
152 |
|
|
|
147 |
return nb_mots, polarite, subjectivite, mots_cles, resume1, resume2
|
148 |
|
149 |
|
150 |
+
background_style = """
|
151 |
+
<style>
|
152 |
+
body {
|
153 |
+
background-image: url('bleublancrouge.jpg');
|
154 |
+
background-size: cover;
|
155 |
+
background-repeat: no-repeat;
|
156 |
+
background-attachment: fixed;
|
157 |
+
}
|
158 |
+
</style>
|
159 |
+
"""
|
160 |
+
|
161 |
+
st.markdown(background_style, unsafe_allow_html=True)
|
162 |
+
|
163 |
+
st.title('Text Analysis and Summary')
|
164 |
+
text = st.text_area('Enter text here:')
|
165 |
+
if st.button('Analyze'):
|
166 |
+
if text:
|
167 |
+
nb_mots, polarite, subjectivite, mots_cles, resume1, resume2 = analyze_text(text)
|
168 |
+
st.write(nb_mots)
|
169 |
+
st.write(polarite)
|
170 |
+
st.write(subjectivite)
|
171 |
+
st.write('Mots clés :', ', '.join(mots_cles))
|
172 |
+
st.write(f'Résumé 1 : {resume1}')
|
173 |
+
st.write(f'Résumé 2 : {resume2}')
|
174 |
+
if st.button('Clear'):
|
175 |
+
text = ""
|
176 |
+
|
177 |
+
With this setup, your Streamlit app will display the background image behind your app's content. Make sure the image file is in the same directory as your script, and adjust the CSS properties in the background_style variable as needed to achieve the desired appearance.
|
178 |
+
|
179 |
+
|
180 |
st.title('Text Analysis and Summary')
|
181 |
text = st.text_area('Enter text here:')
|
182 |
|