import gradio as gr from ginger import get_corrections # Assuming ginger.py has the get_corrections function def correct_sentence(text): """ Function to correct the sentence using Ginger API or logic. """ return get_corrections(text) # Create the Gradio Interface def main(): # Set up Gradio input/output interface interface = gr.Interface( fn=correct_sentence, # Function to process the input inputs=gr.inputs.Textbox(lines=2, placeholder="Enter a sentence to correct..."), # Input box outputs=gr.outputs.Textbox(label="Corrected Sentence") # Output box ) # Launch the Gradio app interface.launch() if __name__ == "__main__": main()