sashtech commited on
Commit
47f1f39
·
verified ·
1 Parent(s): 2fc5fd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -1,22 +1,23 @@
1
  import gradio as gr
2
- from ginger import get_corrections # Assuming ginger.py has the get_corrections function
3
 
4
- def correct_sentence(text):
5
  """
6
- Function to correct the sentence using Ginger API or logic.
7
  """
8
- return get_corrections(text)
9
 
10
- # Create the Gradio Interface
11
  def main():
12
- # Set up Gradio input/output interface
13
  interface = gr.Interface(
14
- fn=correct_sentence, # Function to process the input
15
- inputs=gr.inputs.Textbox(lines=2, placeholder="Enter a sentence to correct..."), # Input box
16
- outputs=gr.outputs.Textbox(label="Corrected Sentence") # Output box
 
 
17
  )
18
 
19
- # Launch the Gradio app
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__":