Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
-
|
2 |
-
import streamlit as st
|
3 |
import pandas as pd
|
4 |
import re
|
5 |
import nltk
|
@@ -31,7 +30,7 @@ def standardize(text, remove_digits=True):
|
|
31 |
text = text.lower()
|
32 |
|
33 |
return text
|
34 |
-
|
35 |
st.write("Poetry dataset, content column cleaned from special characters and lowercased")
|
36 |
df.content = df.content.apply(lambda x: ' '.join([word for word in x.split() if word not in (stop)]))
|
37 |
df.content=df.content.apply(standardize)
|
@@ -55,9 +54,7 @@ plt.xticks(rotation=90)
|
|
55 |
st.pyplot()
|
56 |
|
57 |
# distributions of poem types according to ages and authors
|
58 |
-
st.write("Distributions of poem types according to ages and authors,
|
59 |
-
seems that folks in renaissance loved the love themed poems \
|
60 |
-
and nature themed poems became popular later")
|
61 |
le = LabelEncoder()
|
62 |
|
63 |
df.author = le.fit_transform(df.author)
|
|
|
1 |
+
\nimport streamlit as st
|
|
|
2 |
import pandas as pd
|
3 |
import re
|
4 |
import nltk
|
|
|
30 |
text = text.lower()
|
31 |
|
32 |
return text
|
33 |
+
st.set_option('deprecation.showPyplotGlobalUse', False)
|
34 |
st.write("Poetry dataset, content column cleaned from special characters and lowercased")
|
35 |
df.content = df.content.apply(lambda x: ' '.join([word for word in x.split() if word not in (stop)]))
|
36 |
df.content=df.content.apply(standardize)
|
|
|
54 |
st.pyplot()
|
55 |
|
56 |
# distributions of poem types according to ages and authors
|
57 |
+
st.write("Distributions of poem types according to ages and authors, \\nseems that folks in renaissance loved the love themed poems \\nand nature themed poems became popular later")
|
|
|
|
|
58 |
le = LabelEncoder()
|
59 |
|
60 |
df.author = le.fit_transform(df.author)
|