RohitBh commited on
Commit
a3a5584
1 Parent(s): 34c54ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -74,26 +74,19 @@ def display_wordcloud(text_data):
74
  ax.axis("off")
75
  st.pyplot(fig)
76
 
77
- # Function to download CSV file
78
- def download_csv(df):
79
- csv = df.to_csv(index=False)
80
- b64 = base64.b64encode(csv.encode()).decode() # B64 encoding
81
- href = f'<a href="data:file/csv;base64,{b64}" download="sentiment_analysis_results.csv">Download CSV File</a>'
82
- st.markdown(href, unsafe_allow_html=True)
83
-
84
  # Streamlit UI
85
  st.set_page_config(page_title="Sentiment Analysis App", page_icon=":smiley:")
86
  st.title("Sentiment Analysis App")
87
 
88
  # Sidebar
89
  st.sidebar.title("Options")
90
- input_option = st.sidebar.select_slider("Select Input Option", options=["Free Text", "CSV Files"])
91
- selected_model = st.sidebar.select_slider(
92
- "Select Sentiment Analysis Model", options=["VADER", "TextBlob", "Hugging Face"]
93
  )
94
- result_option = st.sidebar.select_slider(
95
  "Select Result Display Option",
96
- options=["DataFrame", "Pie Chart", "Bar Chart", "Keyword Frequency", "Word Cloud", "Comparative Sentiment Analysis"],
97
  )
98
 
99
  # Main content
 
74
  ax.axis("off")
75
  st.pyplot(fig)
76
 
 
 
 
 
 
 
 
77
  # Streamlit UI
78
  st.set_page_config(page_title="Sentiment Analysis App", page_icon=":smiley:")
79
  st.title("Sentiment Analysis App")
80
 
81
  # Sidebar
82
  st.sidebar.title("Options")
83
+ input_option = st.sidebar.selectbox("Select Input Option", ["Free Text", "CSV Files"])
84
+ selected_model = st.sidebar.selectbox(
85
+ "Select Sentiment Analysis Model", ["VADER", "TextBlob", "Hugging Face"]
86
  )
87
+ result_option = st.sidebar.selectbox(
88
  "Select Result Display Option",
89
+ ["DataFrame", "Pie Chart", "Bar Chart", "Keyword Frequency", "Word Cloud", "Comparative Sentiment Analysis"],
90
  )
91
 
92
  # Main content