Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -20,8 +20,8 @@ def convert_text(input_text, grade_level, input_reading_score, model_type):
|
|
| 20 |
with gr.Blocks(css='styles.css') as app:
|
| 21 |
gr.Markdown(APP_DESCRIPTION)
|
| 22 |
|
| 23 |
-
with gr.Tab("
|
| 24 |
-
with gr.Row():
|
| 25 |
readability_model = gr.Radio(choices=model_types, label="Readability Model", value = model_types[0], interactive=True, scale = 2)
|
| 26 |
readability_model_btn = gr.Button("Set Readability Model", scale = 1)
|
| 27 |
|
|
@@ -29,7 +29,7 @@ with gr.Blocks(css='styles.css') as app:
|
|
| 29 |
fn=set_reading_levels,
|
| 30 |
inputs=[readability_model],
|
| 31 |
outputs=[readability_model]
|
| 32 |
-
)
|
| 33 |
|
| 34 |
with gr.Row():
|
| 35 |
input_text = gr.Textbox(label="Input Text", placeholder="Type here...", lines=4, scale = 2)
|
|
@@ -40,13 +40,13 @@ with gr.Blocks(css='styles.css') as app:
|
|
| 40 |
|
| 41 |
fetch_score_and_lvl_btn.click(
|
| 42 |
fn=user_input_readability_level,
|
| 43 |
-
inputs=[input_text,
|
| 44 |
outputs=[output_input_reading_score, output_input_reading_level]
|
| 45 |
)
|
| 46 |
|
| 47 |
|
| 48 |
-
grade_level_fre = gr.Radio(choices=list(fre_levels.keys()), label="Target Reading Level", interactive=True
|
| 49 |
-
grade_level_sbert = gr.Radio(choices=list(sbert_levels.keys()), label="Target Reading Level", interactive=True, visible=(readability_model == model_types[1]))
|
| 50 |
#grade_level = gr.Radio(choices=list(fre_levels.keys()) if readability_model == model_types[0] else list(sbert_levels.keys()), label="Target Reading Level", interactive=True)
|
| 51 |
|
| 52 |
output_reading_level = gr.Textbox(label="Output Reading Level", placeholder="Output Reading Level...", lines=1)
|
|
@@ -59,9 +59,11 @@ with gr.Blocks(css='styles.css') as app:
|
|
| 59 |
|
| 60 |
convert_button.click(
|
| 61 |
fn=convert_text,
|
| 62 |
-
inputs=[input_text, grade_level_fre
|
| 63 |
outputs=[output_converted_text, output_similarity, output_reading_level, output_message]
|
| 64 |
)
|
|
|
|
|
|
|
| 65 |
|
| 66 |
if __name__ == '__main__':
|
| 67 |
app.launch()
|
|
|
|
| 20 |
with gr.Blocks(css='styles.css') as app:
|
| 21 |
gr.Markdown(APP_DESCRIPTION)
|
| 22 |
|
| 23 |
+
with gr.Tab("FRE"):
|
| 24 |
+
"""with gr.Row():
|
| 25 |
readability_model = gr.Radio(choices=model_types, label="Readability Model", value = model_types[0], interactive=True, scale = 2)
|
| 26 |
readability_model_btn = gr.Button("Set Readability Model", scale = 1)
|
| 27 |
|
|
|
|
| 29 |
fn=set_reading_levels,
|
| 30 |
inputs=[readability_model],
|
| 31 |
outputs=[readability_model]
|
| 32 |
+
)"""
|
| 33 |
|
| 34 |
with gr.Row():
|
| 35 |
input_text = gr.Textbox(label="Input Text", placeholder="Type here...", lines=4, scale = 2)
|
|
|
|
| 40 |
|
| 41 |
fetch_score_and_lvl_btn.click(
|
| 42 |
fn=user_input_readability_level,
|
| 43 |
+
inputs=[input_text, "FRE"],
|
| 44 |
outputs=[output_input_reading_score, output_input_reading_level]
|
| 45 |
)
|
| 46 |
|
| 47 |
|
| 48 |
+
grade_level_fre = gr.Radio(choices=list(fre_levels.keys()), label="Target Reading Level", interactive=True)
|
| 49 |
+
#grade_level_sbert = gr.Radio(choices=list(sbert_levels.keys()), label="Target Reading Level", interactive=True, visible=(readability_model == model_types[1]))
|
| 50 |
#grade_level = gr.Radio(choices=list(fre_levels.keys()) if readability_model == model_types[0] else list(sbert_levels.keys()), label="Target Reading Level", interactive=True)
|
| 51 |
|
| 52 |
output_reading_level = gr.Textbox(label="Output Reading Level", placeholder="Output Reading Level...", lines=1)
|
|
|
|
| 59 |
|
| 60 |
convert_button.click(
|
| 61 |
fn=convert_text,
|
| 62 |
+
inputs=[input_text, grade_level_fre, output_input_reading_score, "FRE"],
|
| 63 |
outputs=[output_converted_text, output_similarity, output_reading_level, output_message]
|
| 64 |
)
|
| 65 |
+
#with gr.Tab("SBERT"):
|
| 66 |
+
|
| 67 |
|
| 68 |
if __name__ == '__main__':
|
| 69 |
app.launch()
|