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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -11
app.py CHANGED
@@ -49,15 +49,25 @@ def process_text_pipeline(text):
49
 
50
  return "\n".join(processed_sentences)
51
 
52
- # Improved Gradio UI
53
- with gr.Blocks(css=".gradio-container {background-color: #f3f4f6; color: #333; font-family: 'Arial';}") as interface:
 
 
 
 
 
 
 
 
 
 
54
  gr.Markdown(
55
  """
56
  <h1 style='text-align: center; font-size: 36px;'>🌟 Sarcasm Detection for Customer Reviews 🌟</h1>
57
- <p style='text-align: center; font-size: 18px;'>This web app analyzes customer reviews for sentiment and detects sarcasm in positive reviews.</p>
58
  """
59
  )
60
-
61
  with gr.Tab("Text Input"):
62
  with gr.Row():
63
  text_input = gr.Textbox(
@@ -66,7 +76,7 @@ with gr.Blocks(css=".gradio-container {background-color: #f3f4f6; color: #333; f
66
  placeholder="Enter one or more sentences, each on a new line."
67
  )
68
  result_output = gr.Textbox(label="Results", lines=10, interactive=False)
69
- analyze_button = gr.Button("πŸ” Analyze", elem_id="analyze-button")
70
 
71
  analyze_button.click(process_text_pipeline, inputs=text_input, outputs=result_output)
72
 
@@ -80,12 +90,6 @@ with gr.Blocks(css=".gradio-container {background-color: #f3f4f6; color: #333; f
80
 
81
  file_input.change(process_file, inputs=file_input, outputs=file_output)
82
 
83
- gr.Markdown(
84
- """
85
- <p style='text-align: center;'>Made with ❀️ by <a href='https://huggingface.co/dnzblgn' target='_blank'>dnzblgn</a></p>
86
- """
87
- )
88
-
89
  # Run the interface
90
  if __name__ == "__main__":
91
  interface.launch()
 
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');
56
+ background-size: cover;
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
  )
70
+
71
  with gr.Tab("Text Input"):
72
  with gr.Row():
73
  text_input = gr.Textbox(
 
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
 
 
90
 
91
  file_input.change(process_file, inputs=file_input, outputs=file_output)
92
 
 
 
 
 
 
 
93
  # Run the interface
94
  if __name__ == "__main__":
95
  interface.launch()