manika07 commited on
Commit
47660b1
·
1 Parent(s): bf85a00

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py CHANGED
@@ -72,6 +72,36 @@ def conv_txt(extype):
72
  return papers
73
 
74
  #===Read data===
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  uploaded_file = st.file_uploader("Choose a file", type=['csv'])
76
  st.sidebar.header("Download Results")
77
  st.sidebar.text("Download the tagged results as a CSV file.")
 
72
  return papers
73
 
74
  #===Read data===
75
+
76
+ # uploaded_file = st.file_uploader("Choose a file", type=['csv'])
77
+
78
+ # df = None # Initialize df as None outside the if block
79
+
80
+ # if uploaded_file is not None:
81
+ # df = pd.read_csv(uploaded_file, encoding='latin-1')
82
+ # st.dataframe(df)
83
+
84
+ # # Tag the "Abstract" column with the corresponding categories
85
+ # df['category'] = df['Abstract'].apply(predict_category)
86
+ # # df['category'] = df['category'].str[2:-2]
87
+
88
+ # st.dataframe(df)
89
+
90
+ # st.sidebar.header("Download Results")
91
+ # st.sidebar.text("Download the tagged results as a CSV file.")
92
+
93
+ # if df is not None:
94
+ # csv = df.to_csv(index=False)
95
+ # b64 = base64.b64encode(csv.encode()).decode()
96
+ # st.sidebar.download_button(
97
+ # label="Download",
98
+ # data=b64,
99
+ # file_name="results.csv",
100
+ # mime="text/csv"
101
+ # )
102
+ # else:
103
+ # st.sidebar.text("Please upload a file first to enable the download button.")
104
+
105
  uploaded_file = st.file_uploader("Choose a file", type=['csv'])
106
  st.sidebar.header("Download Results")
107
  st.sidebar.text("Download the tagged results as a CSV file.")