Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from ginger import
|
| 3 |
|
| 4 |
-
def
|
| 5 |
"""
|
| 6 |
-
|
| 7 |
"""
|
| 8 |
-
return
|
| 9 |
|
| 10 |
-
# Create the Gradio Interface
|
| 11 |
def main():
|
| 12 |
-
#
|
| 13 |
interface = gr.Interface(
|
| 14 |
-
fn=
|
| 15 |
-
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter a sentence
|
| 16 |
-
outputs=gr.outputs.Textbox(label="Corrected Sentence") # Output box
|
|
|
|
|
|
|
| 17 |
)
|
| 18 |
|
| 19 |
-
# Launch the
|
| 20 |
interface.launch()
|
| 21 |
|
| 22 |
if __name__ == "__main__":
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from ginger import correct_sentence # Import the correct_sentence function from ginger.py
|
| 3 |
|
| 4 |
+
def grammar_corrector(text):
|
| 5 |
"""
|
| 6 |
+
This function calls the Ginger API function to correct the text.
|
| 7 |
"""
|
| 8 |
+
return correct_sentence(text)
|
| 9 |
|
|
|
|
| 10 |
def main():
|
| 11 |
+
# Create the Gradio interface
|
| 12 |
interface = gr.Interface(
|
| 13 |
+
fn=grammar_corrector, # Function to correct the grammar
|
| 14 |
+
inputs=gr.inputs.Textbox(lines=2, placeholder="Enter a sentence..."), # Input box for sentence
|
| 15 |
+
outputs=gr.outputs.Textbox(label="Corrected Sentence"), # Output box for corrected sentence
|
| 16 |
+
title="Grammar Correction App", # Title for the app
|
| 17 |
+
description="Enter a sentence and click 'Submit' to see the corrected version.", # Brief description
|
| 18 |
)
|
| 19 |
|
| 20 |
+
# Launch the interface
|
| 21 |
interface.launch()
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|