Rahatara commited on
Commit
c512f6f
·
verified ·
1 Parent(s): 18fd000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -12
app.py CHANGED
@@ -45,18 +45,29 @@ def analyze_text(text):
45
  )
46
  return response.text if response else "No response generated."
47
 
48
- # Example scenarios for gender discrimination analysis
49
- example_scenarios = [
50
- "During a team meeting, whenever a female colleague tried to express her opinion, she was often interrupted or talked over by male colleagues.",
51
- "The feedback given to female employees often focuses more on their demeanor and less on their actual accomplishments.",
52
- "Male employees are more frequently considered for promotions and challenging projects, even when female employees have similar or superior qualifications.",
53
- "During a hiring panel, female candidates were often asked about their personal life, family plans, and how they would balance home and work.",
54
- "There are significant wage discrepancies between male and female employees who hold the same position and possess comparable experience.",
55
- "Some male colleagues often make inappropriate jokes or comments about female employees' appearances and attire."
56
- ]
 
 
 
 
 
 
 
 
57
 
58
  # Gradio interface setup
59
- with gr.Blocks() as app:
 
 
 
60
  with gr.Tab("Text Analysis"):
61
  text_input = gr.Textbox(label="Enter Text or Select an Example", placeholder="Type here or select an example...", lines=4)
62
  analyze_text_btn = gr.Button("Analyze Text")
@@ -65,8 +76,7 @@ with gr.Blocks() as app:
65
  examples = gr.Examples(
66
  examples=example_scenarios,
67
  inputs=text_input,
68
- outputs=text_output,
69
- # fn=analyze_text # Automatically analyze when an example is selected
70
  )
71
 
72
  analyze_text_btn.click(
 
45
  )
46
  return response.text if response else "No response generated."
47
 
48
+ # Custom CSS for branding and animation
49
+ css = """
50
+ body { font-family: 'Arial', sans-serif; background-color: #f0f0f0; }
51
+ h1 { color: #333; animation: fadeIn 2s; }
52
+ @keyframes fadeIn {
53
+ from { opacity: 0; }
54
+ to { opacity: 1; }
55
+ }
56
+ #logo { font-size: 48px; color: #5f4b8b; animation: slideIn 2s; }
57
+ @keyframes slideIn {
58
+ 0% { margin-left: -200px; }
59
+ 100% { margin-left: 0px; }
60
+ }
61
+ .button { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; }
62
+ .button:hover { opacity: 0.8; }
63
+ .textbox { width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; box-sizing: border-box; }
64
+ """
65
 
66
  # Gradio interface setup
67
+ with gr.Blocks(css=css) as app:
68
+ gr.Markdown("<div id='logo'>J<span>ustEva</span></div>")
69
+ gr.Markdown("<h1 style='text-align: center; color: #5f4b8b;'>Gender Bias Analysis Platform</h1>")
70
+ gr.Markdown("<p style='text-align: center; font-size: 16px; color: #4a4a4a;'>Powered by AI to advocate against gender-based violence</p>")
71
  with gr.Tab("Text Analysis"):
72
  text_input = gr.Textbox(label="Enter Text or Select an Example", placeholder="Type here or select an example...", lines=4)
73
  analyze_text_btn = gr.Button("Analyze Text")
 
76
  examples = gr.Examples(
77
  examples=example_scenarios,
78
  inputs=text_input,
79
+ outputs=text_output
 
80
  )
81
 
82
  analyze_text_btn.click(