Spaces:
Runtime error
Runtime error
File size: 574 Bytes
2d23730 10bc260 67ddc4b 2d23730 10bc260 2d23730 59dbede 2d23730 10bc260 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from transformers import pipeline
import gradio as gr
corrector = pipeline(
'text2text-generation',
'pszemraj/flan-t5-large-grammar-synthesis',
)
def correct(text):
sentences = text.split(".")
output = ""
for sentence in sentences:
sentence += "."
output += corrector(sentence)[0]['generated_text']
return output
iface = gr.Interface(
fn= correct,
inputs= "text",
outputs= "text",
title="Aeravat Grammar Correction",
)
# Launch the Gradio interface
iface.launch(share=True)
|