radames's picture
Update app.py
eb1aa98
raw
history blame contribute delete
No virus
473 Bytes
import gradio as gr
import enchant
block = gr.Blocks()
speller = enchant.Dict("en_US")
def predict(text):
spells = speller.suggest(text)
return [[s] for s in spells]
with block:
gr.Markdown("# Hello [PyEnchant](http://pyenchant.github.io/pyenchant/)")
text_input = gr.Text()
text_out = gr.Dataframe(headers=["Spells"], datatype=["str"])
btn = gr.Button()
btn.click(fn=predict, inputs=text_input, outputs=text_out)
block.launch()