arjahojnik commited on
Commit
56f0319
·
verified ·
1 Parent(s): 26ab425

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -15
app.py CHANGED
@@ -86,27 +86,29 @@ with gr.Blocks(css=".gradio-container { max-width: 900px; margin: auto; padding:
86
  "Predict the sentiment of your text review using RNN-based models."
87
  )
88
 
 
89
  with gr.Row():
90
- with gr.Column():
91
- text_input = gr.Textbox(
92
- label="Enter your text here:",
93
- lines=3,
94
- placeholder="Type your review here..."
95
- )
96
-
97
- with gr.Row():
98
- gru_output = gr.Textbox(label="Predicted Sentiment (GRU Model)", interactive=False)
99
- lstm_output = gr.Textbox(label="Predicted Sentiment (LSTM Model)", interactive=False)
100
- bilstm_output = gr.Textbox(label="Predicted Sentiment (BiLSTM Model)", interactive=False)
101
 
102
- with gr.Row():
103
- statistics_output = gr.Textbox(label="Statistics (Lowest, Highest, Average)", interactive=False)
104
-
105
- # Buttons placed together in a row
106
  with gr.Row():
107
  analyze_button = gr.Button("Analyze Sentiment", variant="primary") # Blue button
108
  clear_button = gr.ClearButton([text_input, gru_output, lstm_output, bilstm_output, statistics_output]) # Clear button
109
 
 
 
 
 
 
 
 
 
 
 
110
  # Button to analyze sentiment and show statistics
111
  def process_input_and_analyze(text_input):
112
  results, statistics = analyze_sentiment_and_statistics(text_input)
 
86
  "Predict the sentiment of your text review using RNN-based models."
87
  )
88
 
89
+ # Text input box
90
  with gr.Row():
91
+ text_input = gr.Textbox(
92
+ label="Enter your text here:",
93
+ lines=3,
94
+ placeholder="Type your review here..."
95
+ )
 
 
 
 
 
 
96
 
97
+ # Buttons placed together in a row (second line)
 
 
 
98
  with gr.Row():
99
  analyze_button = gr.Button("Analyze Sentiment", variant="primary") # Blue button
100
  clear_button = gr.ClearButton([text_input, gru_output, lstm_output, bilstm_output, statistics_output]) # Clear button
101
 
102
+ # Prediction and statistics boxes
103
+ with gr.Row():
104
+ with gr.Column():
105
+ gru_output = gr.Textbox(label="Predicted Sentiment (GRU Model)", interactive=False)
106
+ lstm_output = gr.Textbox(label="Predicted Sentiment (LSTM Model)", interactive=False)
107
+ bilstm_output = gr.Textbox(label="Predicted Sentiment (BiLSTM Model)", interactive=False)
108
+
109
+ with gr.Column():
110
+ statistics_output = gr.Textbox(label="Statistics (Lowest, Highest, Average)", interactive=False)
111
+
112
  # Button to analyze sentiment and show statistics
113
  def process_input_and_analyze(text_input):
114
  results, statistics = analyze_sentiment_and_statistics(text_input)