Spaces:
Sleeping
Sleeping
Update Core Analysis Logic.py
Browse files- Core Analysis Logic.py +20 -1
Core Analysis Logic.py
CHANGED
|
@@ -13,4 +13,23 @@ def analyze_essay(essay):
|
|
| 13 |
"vocabulary": vocab_band,
|
| 14 |
"grammar": grammar_band,
|
| 15 |
"overall": (vocab_band + grammar_band) / 2
|
| 16 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"vocabulary": vocab_band,
|
| 14 |
"grammar": grammar_band,
|
| 15 |
"overall": (vocab_band + grammar_band) / 2
|
| 16 |
+
}
|
| 17 |
+
# app.py (bottom section)
|
| 18 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 19 |
+
gr.Markdown("## IELTS Writing Evaluator")
|
| 20 |
+
|
| 21 |
+
with gr.Row():
|
| 22 |
+
input_essay = gr.Textbox(label="Your Essay", lines=10)
|
| 23 |
+
output_scores = gr.JSON(label="Results")
|
| 24 |
+
|
| 25 |
+
gr.Examples(
|
| 26 |
+
examples=[
|
| 27 |
+
["Education plays a vital role in societal development..."]
|
| 28 |
+
],
|
| 29 |
+
inputs=input_essay
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
submit = gr.Button("Evaluate")
|
| 33 |
+
submit.click(analyze_essay, inputs=input_essay, outputs=output_scores)
|
| 34 |
+
|
| 35 |
+
demo.launch()
|