cptcrk commited on
Commit
f37a83b
Β·
verified Β·
1 Parent(s): b91a4f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -57,7 +57,7 @@ def analyze_multilingual_sentences(text):
57
  # Maak een grafiek met de sentimentverdeling
58
  labels = ["Positive", "Neutral", "Negative"]
59
  values = [positive_count, neutral_count, negative_count]
60
- colors = ["#4CAF50", "#2196F3", "#F44336"] # Groen, Blauw, Rood
61
 
62
  fig, ax = plt.subplots()
63
  ax.pie(values, labels=labels, autopct='%1.1f%%', startangle=90, colors=colors)
@@ -113,7 +113,7 @@ with gr.Blocks() as demo:
113
  # Oranje knop voor sentimentanalyse
114
  analyze_button = gr.Button("Tell me how I feel", elem_id="analyze-btn")
115
  output_box = gr.HTML(label="Results")
116
- plot_box = gr.Plot(label="Sentiment Distribution", visible=False)
117
 
118
  analyze_button.click(analyze_multilingual_sentences, inputs=input_box, outputs=[output_box, plot_box])
119
 
@@ -132,6 +132,11 @@ css = """
132
  font-size: 16px;
133
  padding: 10px 20px;
134
  border-radius: 8px;
 
 
 
 
 
135
  }
136
  """
137
 
@@ -140,3 +145,4 @@ demo.launch(share=True)
140
 
141
 
142
 
 
 
57
  # Maak een grafiek met de sentimentverdeling
58
  labels = ["Positive", "Neutral", "Negative"]
59
  values = [positive_count, neutral_count, negative_count]
60
+ colors = ["#FFA500", "#2196F3", "#F44336"] # Oranje, Blauw, Rood
61
 
62
  fig, ax = plt.subplots()
63
  ax.pie(values, labels=labels, autopct='%1.1f%%', startangle=90, colors=colors)
 
113
  # Oranje knop voor sentimentanalyse
114
  analyze_button = gr.Button("Tell me how I feel", elem_id="analyze-btn")
115
  output_box = gr.HTML(label="Results")
116
+ plot_box = gr.Plot(label="Sentiment Distribution")
117
 
118
  analyze_button.click(analyze_multilingual_sentences, inputs=input_box, outputs=[output_box, plot_box])
119
 
 
132
  font-size: 16px;
133
  padding: 10px 20px;
134
  border-radius: 8px;
135
+ border: none;
136
+ cursor: pointer;
137
+ }
138
+ #analyze-btn:hover {
139
+ background-color: #FF8C00 !important;
140
  }
141
  """
142
 
 
145
 
146
 
147
 
148
+