Spaces:
Sleeping
Sleeping
File size: 540 Bytes
1a1206e |
1 2 3 4 5 6 7 8 9 10 11 12 |
import gradio as gr
from transformers import pipeline
corrector = pipeline(task="text2text-generation", model="pszemraj/flan-t5-large-grammar-synthesis")
def grammar_corrector(sentence):
result = corrector(sentence)
return result[0]['generated_text']
interface = gr.Interface(fn=grammar_corrector, inputs=gr.Textbox(placeholder= "Type or paste your sentence", lines = 2, max_lines=5), outputs=gr.Textbox(lines = 3),
title="Grammar Suggestion App")
interface.launch(server_name="0.0.0.0", server_port=7860) |