Spaces:
Sleeping
Sleeping
faizanmumtaz
commited on
Commit
β’
b7b04c7
1
Parent(s):
9676914
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
from main import _main
|
4 |
+
|
5 |
+
st.set_page_config(page_title="Reviews Sentiment Analyzer",page_icon="π")
|
6 |
+
|
7 |
+
uploaded_file = st.file_uploader("Choose a CSV file; it must have a column with the name 'reviews'", type=["csv"])
|
8 |
+
|
9 |
+
if uploaded_file is not None:
|
10 |
+
|
11 |
+
df = pd.read_csv(uploaded_file)
|
12 |
+
|
13 |
+
st.info("Only 20 rows will be analyzed in reviews column.")
|
14 |
+
|
15 |
+
st.write('Original Data:', df)
|
16 |
+
|
17 |
+
if st.button('Analyze Reviews Sentiment!'):
|
18 |
+
|
19 |
+
with st.spinner("Please wait..."):
|
20 |
+
|
21 |
+
_main(df)
|