cychristophercyc commited on
Commit
bde276c
1 Parent(s): 1359059

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -5
app.py CHANGED
@@ -51,8 +51,18 @@ if genre == ':rainbow[Science and Technology]':
51
 
52
  # upload file
53
  uploaded_file = st.file_uploader("Choose a file")
54
- dataframe = pd.read_csv(uploaded_file)
 
 
 
 
 
 
 
 
 
55
 
 
56
  st.write(dataframe)
57
  a = 0
58
  content_list = []
@@ -88,7 +98,6 @@ if st.button("Classify"):
88
  filtered_list = [d for d in list_of_dictionaries if d['Label'].strip() == select]
89
 
90
 
91
- for dictionary in filtered_list:
92
- summary = summarizer(dictionary["Text"])
93
- # Display the summary
94
- st.write("Summary:", summary[0]['summary_text']) # Adjust based on the summarizer output
 
51
 
52
  # upload file
53
  uploaded_file = st.file_uploader("Choose a file")
54
+ if uploaded_file is not None:
55
+ dataframe = pd.read_csv(uploaded_file)
56
+
57
+ # Continue with your Streamlit app logic, e.g., displaying the DataFrame
58
+ st.write(dataframe)
59
+
60
+ # rest of your code to process the dataframe
61
+ else:
62
+ # You can choose to write an error message or just do nothing
63
+ st.write("Please upload a CSV file to proceed.")
64
 
65
+
66
  st.write(dataframe)
67
  a = 0
68
  content_list = []
 
98
  filtered_list = [d for d in list_of_dictionaries if d['Label'].strip() == select]
99
 
100
 
101
+ for m in len(filtered_list):
102
+ Sum = summarizer(content_list[m])
103
+ st.write("Summary:", content_list[m])