Spaces:
Sleeping
Sleeping
Updates
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
def calc_input_reading_level(input_text):
|
4 |
# Placeholder for actual implementation of the reading level calculation.
|
5 |
return len(input_text) % 10 # Random operation as a placeholder for demonstration.
|
@@ -14,18 +12,21 @@ def generate_and_analyze_text(input_text, target_level):
|
|
14 |
|
15 |
with gr.Blocks() as app:
|
16 |
with gr.Row():
|
17 |
-
with gr.Column():
|
18 |
input_text1 = gr.Textbox(label="Input Text for Reading Level")
|
19 |
button1 = gr.Button("Calculate Reading Level")
|
20 |
-
with gr.Column():
|
|
|
|
|
|
|
|
|
21 |
input_text2 = gr.Textbox(label="Input Text for Generation")
|
22 |
target_level = gr.Dropdown(choices=["1", "2", "3", "4", "5"], label="Target Reading Level")
|
23 |
button2 = gr.Button("Generate and Analyze Text")
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
output_text_similarity = gr.Textbox(label="Output Text Similarity to Input Text", visible=False)
|
29 |
|
30 |
button1.click(
|
31 |
fn=calc_input_reading_level,
|
|
|
|
|
|
|
1 |
def calc_input_reading_level(input_text):
|
2 |
# Placeholder for actual implementation of the reading level calculation.
|
3 |
return len(input_text) % 10 # Random operation as a placeholder for demonstration.
|
|
|
12 |
|
13 |
with gr.Blocks() as app:
|
14 |
with gr.Row():
|
15 |
+
with gr.Column(scale=1):
|
16 |
input_text1 = gr.Textbox(label="Input Text for Reading Level")
|
17 |
button1 = gr.Button("Calculate Reading Level")
|
18 |
+
with gr.Column(scale=1):
|
19 |
+
input_reading_level = gr.Textbox(label="Input Text Reading Level")
|
20 |
+
|
21 |
+
with gr.Row():
|
22 |
+
with gr.Column(scale=1):
|
23 |
input_text2 = gr.Textbox(label="Input Text for Generation")
|
24 |
target_level = gr.Dropdown(choices=["1", "2", "3", "4", "5"], label="Target Reading Level")
|
25 |
button2 = gr.Button("Generate and Analyze Text")
|
26 |
+
with gr.Column(scale=1):
|
27 |
+
output_text = gr.Textbox(label="Output Text")
|
28 |
+
output_reading_level = gr.Textbox(label="Output Text Reading Level")
|
29 |
+
output_text_similarity = gr.Textbox(label="Output Text Similarity to Input Text")
|
|
|
30 |
|
31 |
button1.click(
|
32 |
fn=calc_input_reading_level,
|