Uvini commited on
Commit
db5ebc3
·
1 Parent(s): 726abef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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