File size: 863 Bytes
2fc5fd9
47f1f39
5bee7e5
47f1f39
5bee7e5
47f1f39
5bee7e5
47f1f39
5bee7e5
2fc5fd9
47f1f39
2fc5fd9
47f1f39
c824c99
 
47f1f39
 
2fc5fd9
bac4259
47f1f39
2fc5fd9
5bee7e5
 
 
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
import gradio as gr
from ginger import correct_sentence  # Import the correct_sentence function from ginger.py

def grammar_corrector(text):
    """
    This function calls the Ginger API function to correct the text.
    """
    return correct_sentence(text)

def main():
    # Create the Gradio interface
    interface = gr.Interface(
        fn=grammar_corrector,  # Function to correct the grammar
        inputs=gr.Textbox(lines=2, placeholder="Enter a sentence..."),  # Input box for sentence
        outputs=gr.Textbox(label="Corrected Sentence"),  # Output box for corrected sentence
        title="Grammar Correction App",  # Title for the app
        description="Enter a sentence and click 'Submit' to see the corrected version.",  # Brief description
    )
    
    # Launch the interface
    interface.launch()

if __name__ == "__main__":
    main()