Spaces:
Sleeping
Sleeping
File size: 710 Bytes
2fc5fd9 5bee7e5 2fc5fd9 5bee7e5 2fc5fd9 5bee7e5 2fc5fd9 5bee7e5 2fc5fd9 bac4259 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 |
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()
|