dnzblgn commited on
Commit
bbd99ff
Β·
verified Β·
1 Parent(s): 62b7f2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -49,7 +49,7 @@ def process_text_pipeline(text):
49
 
50
  return "\n".join(processed_sentences)
51
 
52
- # Add CSS with background image
53
  background_css = """
54
  .gradio-container {
55
  background-image: url('https://huggingface.co/spaces/dnzblgn/Sarcasm_Detection/resolve/main/image.png');
@@ -57,13 +57,24 @@ background_css = """
57
  background-position: center;
58
  color: white;
59
  }
 
 
 
 
 
 
 
 
 
 
 
60
  """
61
 
62
- # Gradio UI with updated background image
63
  with gr.Blocks(css=background_css) as interface:
64
  gr.Markdown(
65
  """
66
- <h1 style='text-align: center; font-size: 36px;'>🌟 Sarcasm Detection for Customer Reviews 🌟</h1>
67
  <p style='text-align: center; font-size: 18px;'>Analyze the sentiment of customer reviews and detect sarcasm in positive reviews.</p>
68
  """
69
  )
@@ -76,7 +87,7 @@ with gr.Blocks(css=background_css) as interface:
76
  placeholder="Enter one or more sentences, each on a new line."
77
  )
78
  result_output = gr.Textbox(label="Results", lines=10, interactive=False)
79
- analyze_button = gr.Button("πŸ” Process")
80
 
81
  analyze_button.click(process_text_pipeline, inputs=text_input, outputs=result_output)
82
 
 
49
 
50
  return "\n".join(processed_sentences)
51
 
52
+ # CSS for transparent boxes and background image
53
  background_css = """
54
  .gradio-container {
55
  background-image: url('https://huggingface.co/spaces/dnzblgn/Sarcasm_Detection/resolve/main/image.png');
 
57
  background-position: center;
58
  color: white;
59
  }
60
+
61
+ .gr-input, .gr-textbox {
62
+ background-color: rgba(255, 255, 255, 0.3) !important; /* Make the boxes transparent */
63
+ border-radius: 10px;
64
+ padding: 10px;
65
+ color: black !important;
66
+ }
67
+
68
+ h1, h2, p {
69
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* Add subtle shadow to text for better readability */
70
+ }
71
  """
72
 
73
+ # Gradio UI with updated header and transparent design
74
  with gr.Blocks(css=background_css) as interface:
75
  gr.Markdown(
76
  """
77
+ <h1 style='text-align: center; font-size: 36px;'>🌟 Sentiment Analysis Powered by Sarcasm Detection 🌟</h1>
78
  <p style='text-align: center; font-size: 18px;'>Analyze the sentiment of customer reviews and detect sarcasm in positive reviews.</p>
79
  """
80
  )
 
87
  placeholder="Enter one or more sentences, each on a new line."
88
  )
89
  result_output = gr.Textbox(label="Results", lines=10, interactive=False)
90
+ analyze_button = gr.Button("πŸ” Analyze")
91
 
92
  analyze_button.click(process_text_pipeline, inputs=text_input, outputs=result_output)
93