|
|
| import gradio as gr |
|
|
| def simplify_text(text, reading_age, symbolise): |
| simplified = f"Reading Age {reading_age}: |
| |
| {text}" |
| if symbolise: |
| simplified += "\n\n[Paste this into Widgit Online to symbolise it.]" |
| return simplified |
|
|
| iface = gr.Interface( |
| fn=simplify_text, |
| inputs=[ |
| gr.Textbox(label="Paste your text here", lines=10), |
| gr.Slider(minimum=5, maximum=18, step=1, value=9, label="Target Reading Age"), |
| gr.Checkbox(label="Would you like to symbolise this using Widgit Online?") |
| ], |
| outputs="text", |
| title="Tower Hamlets Inclusive Text Simplifier", |
| description="Developed by Ben Annett, Tower Hamlets Learning Advisory Service. Please anonymise documents before uploading." |
| ) |
|
|
| iface.launch() |
|
|