nnsohamnn commited on
Commit
9a3b49f
·
verified ·
1 Parent(s): 4b1c196

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -10
app.py CHANGED
@@ -145,29 +145,42 @@ with gr.Blocks(title="Science Text Analyzer") as demo:
145
  gr.Markdown("# Science Text Analyzer")
146
 
147
  with gr.Tab("Classify Text"):
148
- gr.Markdown("## Classify scientific text into Science, Maths, or History")
 
 
 
 
149
  with gr.Row():
150
  with gr.Column():
151
- text_input = gr.Textbox(label="Enter text", lines=5)
152
  classify_button = gr.Button("Classify")
153
  with gr.Column():
154
- output = gr.Textbox(label="Classification Result")
155
  classify_button.click(fn=classify_interface, inputs=text_input, outputs=output)
156
 
157
  with gr.Tab("Generate Text"):
158
- gr.Markdown("## Generate scientific text based on a prompt")
 
 
 
 
159
  with gr.Row():
160
  with gr.Column():
161
- prompt_input = gr.Textbox(label="Enter a prompt", lines=3)
162
- length_slider = gr.Slider(minimum=10, maximum=200, value=50, step=10, label="Maximum Length")
163
- temp_slider = gr.Slider(minimum=0.1, maximum=1.5, value=0.7, step=0.1, label="Temperature (Creativity)")
164
  generate_button = gr.Button("Generate")
165
  with gr.Column():
166
- generated_output = gr.Textbox(label="Generated Text", lines=8)
167
  generate_button.click(fn=generate_interface, inputs=[prompt_input, length_slider, temp_slider], outputs=generated_output)
168
 
169
- gr.Markdown("### About")
170
- gr.Markdown("This app uses deep learning models trained on scientific texts to classify and generate content related to Physics, Chemistry, and Biology.")
 
 
 
 
171
 
172
  # Launch the app
173
  demo.launch()
 
 
145
  gr.Markdown("# Science Text Analyzer")
146
 
147
  with gr.Tab("Classify Text"):
148
+ gr.Markdown("### Classify Academic Text")
149
+ gr.Markdown(
150
+ "This tool automatically classifies a given passage into one of the following academic categories: "
151
+ "**Science**, **Mathematics**, or **History**. Simply enter your text below to see the predicted subject."
152
+ )
153
  with gr.Row():
154
  with gr.Column():
155
+ text_input = gr.Textbox(label="Enter Text", lines=5, placeholder="Paste a sentence or paragraph here...")
156
  classify_button = gr.Button("Classify")
157
  with gr.Column():
158
+ output = gr.Textbox(label="Classification Result", placeholder="The predicted subject and confidence will appear here.")
159
  classify_button.click(fn=classify_interface, inputs=text_input, outputs=output)
160
 
161
  with gr.Tab("Generate Text"):
162
+ gr.Markdown("### Generate Academic Text")
163
+ gr.Markdown(
164
+ "Use this tool to generate educational text based on a given prompt. "
165
+ "You can control the output length and creativity using the sliders below."
166
+ )
167
  with gr.Row():
168
  with gr.Column():
169
+ prompt_input = gr.Textbox(label="Enter a Prompt", lines=3, placeholder="Type an introductory sentence or concept...")
170
+ length_slider = gr.Slider(minimum=10, maximum=200, value=50, step=10, label="Maximum Length (words)")
171
+ temp_slider = gr.Slider(minimum=0.1, maximum=1.5, value=0.7, step=0.1, label="Temperature (Creativity Level)")
172
  generate_button = gr.Button("Generate")
173
  with gr.Column():
174
+ generated_output = gr.Textbox(label="Generated Text", lines=8, placeholder="The generated text will appear here.")
175
  generate_button.click(fn=generate_interface, inputs=[prompt_input, length_slider, temp_slider], outputs=generated_output)
176
 
177
+ gr.Markdown("### About This App")
178
+ gr.Markdown(
179
+ "The Science Text Analyzer uses deep learning models trained on academic corpora to classify and generate content "
180
+ "relevant to disciplines such as Science, Mathematics, and History. It combines a classifier with a sequence-based language model "
181
+ "to support educational research and content creation."
182
+ )
183
 
184
  # Launch the app
185
  demo.launch()
186
+