Ahmad-Moiz commited on
Commit
e5d06f2
Β·
1 Parent(s): dfe2406

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -2
app.py CHANGED
@@ -3,6 +3,20 @@ from transformers import pipeline
3
 
4
  model_path = "citizenlab/twitter-xlm-roberta-base-sentiment-finetunned"
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  st.set_page_config(page_title="Sentiment Analysis App")
7
 
8
  sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
@@ -11,7 +25,10 @@ st.title("Sentiment Analysis App")
11
 
12
  user_input = st.text_area("Enter a message:", height=150)
13
 
14
- if st.button("Analyze Sentiment πŸš€", key="analyze_button", help="Click to analyze sentiment"):
 
 
 
15
  if user_input:
16
  # Perform sentiment analysis
17
  st.markdown("---")
@@ -36,7 +53,7 @@ if st.button("Analyze Sentiment πŸš€", key="analyze_button", help="Click to anal
36
  button_color = "#ff66cc" # pink color for neutral sentiment
37
 
38
  st.markdown(
39
- f'<a style="background-color:{button_color};color:orange;text-decoration:none;padding:8px 12px;'
40
  f"border-radius:5px;display:inline-block;margin-top:15px;"
41
  f'font-weight:bold;" href="https://www.streamlit.io/">'
42
  f'Share Analysis on Streamlit <span style="font-size:20px;">πŸ”—</span></a>',
 
3
 
4
  model_path = "citizenlab/twitter-xlm-roberta-base-sentiment-finetunned"
5
 
6
+ # Setting the background color of the Streamlit app
7
+ PAGE_BG_COLOR = "#FFA500" # Orange color
8
+
9
+ st.markdown(
10
+ f"""
11
+ <style>
12
+ .reportview-container {{
13
+ background-color: {PAGE_BG_COLOR};
14
+ }}
15
+ </style>
16
+ """,
17
+ unsafe_allow_html=True,
18
+ )
19
+
20
  st.set_page_config(page_title="Sentiment Analysis App")
21
 
22
  sentiment_classifier = pipeline("text-classification", model=model_path, tokenizer=model_path)
 
25
 
26
  user_input = st.text_area("Enter a message:", height=150)
27
 
28
+ if st.button(
29
+ "Analyze Sentiment πŸš€", key="analyze_button", help="Click to analyze sentiment",
30
+ background_color="black", text_color="white", border_radius=5
31
+ ):
32
  if user_input:
33
  # Perform sentiment analysis
34
  st.markdown("---")
 
53
  button_color = "#ff66cc" # pink color for neutral sentiment
54
 
55
  st.markdown(
56
+ f'<a style="background-color:{button_color};color:white;text-decoration:none;padding:8px 12px;'
57
  f"border-radius:5px;display:inline-block;margin-top:15px;"
58
  f'font-weight:bold;" href="https://www.streamlit.io/">'
59
  f'Share Analysis on Streamlit <span style="font-size:20px;">πŸ”—</span></a>',