Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -68,17 +68,17 @@ if file is not None:
|
|
68 |
|
69 |
# Define sentiment colors
|
70 |
sentiment_colors = {'POSITIVE': 'FFC845', 'NEGATIVE': '52565E'}
|
71 |
-
|
72 |
# Map sentiment to colours and apply to review column
|
73 |
df['sentiment'] = df['sentiment'].apply(lambda x: f'<span style="color: {sentiment_colors[x]}">{x}</span>')
|
74 |
-
|
75 |
# Create HTML table with no border and centered text
|
76 |
table_html = (df.style
|
77 |
.set_properties(**{'text-align': 'center'})
|
78 |
.set_table_styles(
|
79 |
[{'selector': 'th', 'props': [('border', '0px')]}, {'selector': 'td', 'props': [('border', '0px')]}])
|
80 |
.render())
|
81 |
-
|
82 |
# Display the table
|
83 |
st.write(table_html, unsafe_allow_html=True)
|
84 |
|
|
|
68 |
|
69 |
# Define sentiment colors
|
70 |
sentiment_colors = {'POSITIVE': 'FFC845', 'NEGATIVE': '52565E'}
|
71 |
+
|
72 |
# Map sentiment to colours and apply to review column
|
73 |
df['sentiment'] = df['sentiment'].apply(lambda x: f'<span style="color: {sentiment_colors[x]}">{x}</span>')
|
74 |
+
|
75 |
# Create HTML table with no border and centered text
|
76 |
table_html = (df.style
|
77 |
.set_properties(**{'text-align': 'center'})
|
78 |
.set_table_styles(
|
79 |
[{'selector': 'th', 'props': [('border', '0px')]}, {'selector': 'td', 'props': [('border', '0px')]}])
|
80 |
.render())
|
81 |
+
|
82 |
# Display the table
|
83 |
st.write(table_html, unsafe_allow_html=True)
|
84 |
|