Spaces:
Build error
Build error
Pietro Lesci
commited on
Commit
•
df4398a
1
Parent(s):
8caa070
reformat
Browse files- main.py +2 -2
- src/components.py +8 -7
- src/utils.py +1 -1
main.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
from src.components import
|
4 |
from src.utils import convert_df, get_logo, read_file
|
5 |
|
6 |
# app configs
|
@@ -12,7 +12,7 @@ st.set_page_config(
|
|
12 |
menu_items={
|
13 |
"Get Help": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
|
14 |
"Report a Bug": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
|
15 |
-
"About":
|
16 |
},
|
17 |
)
|
18 |
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
+
from src.components import faq, footer, form, presentation
|
4 |
from src.utils import convert_df, get_logo, read_file
|
5 |
|
6 |
# app configs
|
|
|
12 |
menu_items={
|
13 |
"Get Help": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
|
14 |
"Report a Bug": "https://github.com/MilaNLProc/wordify-webapp-streamlit/issues/new",
|
15 |
+
"About": "By the __Wordify__ team.",
|
16 |
},
|
17 |
)
|
18 |
|
src/components.py
CHANGED
@@ -5,7 +5,6 @@ from src.preprocessing import PreprocessingPipeline
|
|
5 |
from src.wordifier import input_transform, output_transform, wordifier
|
6 |
|
7 |
|
8 |
-
@st.experimental_memo
|
9 |
def form(df):
|
10 |
with st.form("my_form"):
|
11 |
col1, col2 = st.columns([1, 2])
|
@@ -88,6 +87,14 @@ def form(df):
|
|
88 |
with st.spinner("Step 4/4: Preparing outputs"):
|
89 |
new_df = output_transform(pos, neg)
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
return new_df
|
92 |
|
93 |
|
@@ -243,9 +250,3 @@ def contacts():
|
|
243 |
|
244 |
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2798.949796165441!2d9.185730115812493!3d45.450667779100726!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4786c405ae6543c9%3A0xf2bb2313b36af88c!2sVia%20Guglielmo%20R%C3%B6ntgen%2C%201%2C%2020136%20Milano%20MI!5e0!3m2!1sit!2sit!4v1569325279433!5m2!1sit!2sit" frameborder="0" style="border:0; width: 100%; height: 312px;" allowfullscreen></iframe>
|
245 |
"""
|
246 |
-
|
247 |
-
|
248 |
-
def about():
|
249 |
-
return """
|
250 |
-
The wordify team
|
251 |
-
"""
|
|
|
5 |
from src.wordifier import input_transform, output_transform, wordifier
|
6 |
|
7 |
|
|
|
8 |
def form(df):
|
9 |
with st.form("my_form"):
|
10 |
col1, col2 = st.columns([1, 2])
|
|
|
87 |
with st.spinner("Step 4/4: Preparing outputs"):
|
88 |
new_df = output_transform(pos, neg)
|
89 |
|
90 |
+
# col1, col2, col3 = st.columns(3)
|
91 |
+
# with col1:
|
92 |
+
# st.metric("Total number of words processed", 3, delta_color="normal")
|
93 |
+
# with col2:
|
94 |
+
# st.metric("Texts processed", 3, delta_color="normal")
|
95 |
+
# with col3:
|
96 |
+
# st.metric("Texts processed", 3, delta_color="normal")
|
97 |
+
|
98 |
return new_df
|
99 |
|
100 |
|
|
|
250 |
|
251 |
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2798.949796165441!2d9.185730115812493!3d45.450667779100726!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4786c405ae6543c9%3A0xf2bb2313b36af88c!2sVia%20Guglielmo%20R%C3%B6ntgen%2C%201%2C%2020136%20Milano%20MI!5e0!3m2!1sit!2sit!4v1569325279433!5m2!1sit!2sit" frameborder="0" style="border:0; width: 100%; height: 312px;" allowfullscreen></iframe>
|
252 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
src/utils.py
CHANGED
@@ -13,7 +13,7 @@ def get_logo(path):
|
|
13 |
return Image.open(path)
|
14 |
|
15 |
|
16 |
-
@st.
|
17 |
def read_file(uploaded_file) -> pd.DataFrame:
|
18 |
file_type = uploaded_file.name.split(".")[-1]
|
19 |
read_fn = SupportedFiles[file_type].value[0]
|
|
|
13 |
return Image.open(path)
|
14 |
|
15 |
|
16 |
+
@st.experimental_memo
|
17 |
def read_file(uploaded_file) -> pd.DataFrame:
|
18 |
file_type = uploaded_file.name.split(".")[-1]
|
19 |
read_fn = SupportedFiles[file_type].value[0]
|