Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ tab1, tab2, tab3 = st.tabs(["π Load Data", "π Tagged ETDs", "π Download
|
|
46 |
with tab1:
|
47 |
#===load data===
|
48 |
|
49 |
-
if uploaded_file is not None:
|
50 |
df = pd.read_csv(uploaded_file, encoding='latin-1')
|
51 |
st.dataframe(df)
|
52 |
|
@@ -54,7 +54,7 @@ with tab2:
|
|
54 |
#===tagged ETDs===
|
55 |
# Tag the "Abstract" column with the corresponding categories
|
56 |
|
57 |
-
if uploaded_file is not None:
|
58 |
df = pd.read_csv(uploaded_file, encoding='latin-1')
|
59 |
st.dataframe(df)
|
60 |
df['category'] = df['Abstract'].apply(predict_category)
|
@@ -72,7 +72,7 @@ with tab3:
|
|
72 |
#===download result===
|
73 |
# Create a download button
|
74 |
|
75 |
-
if st.sidebar.button("Download"):
|
76 |
csv = df.to_csv(index=False)
|
77 |
b64 = base64.b64encode(csv.encode()).decode()
|
78 |
href = f'<a href="data:file/csv;base64,{b64}" download="results.csv">Download csv file</a>'
|
|
|
46 |
with tab1:
|
47 |
#===load data===
|
48 |
|
49 |
+
if uploaded_file is not None:
|
50 |
df = pd.read_csv(uploaded_file, encoding='latin-1')
|
51 |
st.dataframe(df)
|
52 |
|
|
|
54 |
#===tagged ETDs===
|
55 |
# Tag the "Abstract" column with the corresponding categories
|
56 |
|
57 |
+
if uploaded_file is not None:
|
58 |
df = pd.read_csv(uploaded_file, encoding='latin-1')
|
59 |
st.dataframe(df)
|
60 |
df['category'] = df['Abstract'].apply(predict_category)
|
|
|
72 |
#===download result===
|
73 |
# Create a download button
|
74 |
|
75 |
+
if st.sidebar.button("Download"):
|
76 |
csv = df.to_csv(index=False)
|
77 |
b64 = base64.b64encode(csv.encode()).decode()
|
78 |
href = f'<a href="data:file/csv;base64,{b64}" download="results.csv">Download csv file</a>'
|