|
import gradio as gr |
|
from ginger import correct_sentence |
|
|
|
def grammar_corrector(text): |
|
""" |
|
This function calls the Ginger API function to correct the text. |
|
""" |
|
return correct_sentence(text) |
|
|
|
def main(): |
|
|
|
interface = gr.Interface( |
|
fn=grammar_corrector, |
|
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter a sentence..."), |
|
outputs=gr.outputs.Textbox(label="Corrected Sentence"), |
|
title="Grammar Correction App", |
|
description="Enter a sentence and click 'Submit' to see the corrected version.", |
|
) |
|
|
|
|
|
interface.launch() |
|
|
|
if __name__ == "__main__": |
|
main() |
|
|