Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -90,7 +90,7 @@ def main():
|
|
| 90 |
st.title('Sentiment Analysis')
|
| 91 |
st.markdown('Upload an Excel file to get sentiment analytics')
|
| 92 |
|
| 93 |
-
uploaded_file = st.file_uploader("Upload an excel file", type=['xlsx'], key='
|
| 94 |
review_column = None
|
| 95 |
df = None
|
| 96 |
class_names = None # New variable for class names
|
|
@@ -111,9 +111,9 @@ def main():
|
|
| 111 |
review_column = st.selectbox('Select the column from your excel file containing text', chunk.columns)
|
| 112 |
chunk[review_column] = chunk[review_column].astype(str)
|
| 113 |
|
| 114 |
-
filter_words_input = st.text_input('Enter words to filter the data by, separated by comma (or leave empty)') # New input field for filter words
|
| 115 |
filter_words = [] if filter_words_input.strip() == "" else process_filter_words(filter_words_input) # Process the filter words
|
| 116 |
-
class_names = st.text_input('Enter the possible class names separated by comma') # New input field for class names
|
| 117 |
chunk = filter_dataframe(chunk, review_column, filter_words) # Filter the DataFrame
|
| 118 |
|
| 119 |
chunks.append(chunk)
|
|
@@ -123,7 +123,7 @@ def main():
|
|
| 123 |
st.write("An error occurred while reading the uploaded file. Please make sure it's a valid Excel file.")
|
| 124 |
return
|
| 125 |
|
| 126 |
-
start_button = st.button('Start Analysis')
|
| 127 |
|
| 128 |
|
| 129 |
if start_button and df is not None:
|
|
|
|
| 90 |
st.title('Sentiment Analysis')
|
| 91 |
st.markdown('Upload an Excel file to get sentiment analytics')
|
| 92 |
|
| 93 |
+
uploaded_file = st.file_uploader("Upload an excel file", type=['xlsx'], key='unique1')
|
| 94 |
review_column = None
|
| 95 |
df = None
|
| 96 |
class_names = None # New variable for class names
|
|
|
|
| 111 |
review_column = st.selectbox('Select the column from your excel file containing text', chunk.columns)
|
| 112 |
chunk[review_column] = chunk[review_column].astype(str)
|
| 113 |
|
| 114 |
+
filter_words_input = st.text_input('Enter words to filter the data by, separated by comma (or leave empty)', key='filter words') # New input field for filter words
|
| 115 |
filter_words = [] if filter_words_input.strip() == "" else process_filter_words(filter_words_input) # Process the filter words
|
| 116 |
+
class_names = st.text_input('Enter the possible class names separated by comma', key='class names') # New input field for class names
|
| 117 |
chunk = filter_dataframe(chunk, review_column, filter_words) # Filter the DataFrame
|
| 118 |
|
| 119 |
chunks.append(chunk)
|
|
|
|
| 123 |
st.write("An error occurred while reading the uploaded file. Please make sure it's a valid Excel file.")
|
| 124 |
return
|
| 125 |
|
| 126 |
+
start_button = st.button('Start Analysis', key='unique2')
|
| 127 |
|
| 128 |
|
| 129 |
if start_button and df is not None:
|