sashtech commited on
Commit
3e59fb4
1 Parent(s): 0b6e157

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,9 +60,9 @@ def capitalize_sentences_and_nouns(text):
60
  sentence.append(token.text)
61
  corrected_text.append(' '.join(sentence))
62
 
63
- return '\n'.join(corrected_text) # Preserve paragraphs by joining sentences with newline
64
 
65
- # Function to force capitalization of the first letter of every sentence
66
  def force_first_letter_capital(text):
67
  sentences = text.split(". ") # Split by period to get each sentence
68
  capitalized_sentences = [sentence[0].capitalize() + sentence[1:] if sentence else "" for sentence in sentences]
@@ -254,7 +254,7 @@ with gr.Blocks() as demo:
254
  with gr.Tab("Paraphrasing & Grammar Correction"):
255
  t2 = gr.Textbox(lines=5, label='Enter text for paraphrasing and grammar correction')
256
  button2 = gr.Button("🔄 Paraphrase and Correct")
257
- result2 = gr.Textbox(lines=10, label='Corrected Text', placeholder="The corrected text will appear here...")
258
 
259
  # Connect the paraphrasing and correction function to the button
260
  button2.click(fn=paraphrase_and_correct, inputs=t2, outputs=result2)
 
60
  sentence.append(token.text)
61
  corrected_text.append(' '.join(sentence))
62
 
63
+ return ' '.join(corrected_text)
64
 
65
+ # Function to force capitalization of the first letter of every sentence (NEW)
66
  def force_first_letter_capital(text):
67
  sentences = text.split(". ") # Split by period to get each sentence
68
  capitalized_sentences = [sentence[0].capitalize() + sentence[1:] if sentence else "" for sentence in sentences]
 
254
  with gr.Tab("Paraphrasing & Grammar Correction"):
255
  t2 = gr.Textbox(lines=5, label='Enter text for paraphrasing and grammar correction')
256
  button2 = gr.Button("🔄 Paraphrase and Correct")
257
+ result2 = gr.Textbox(lines=5, label='Corrected Text')
258
 
259
  # Connect the paraphrasing and correction function to the button
260
  button2.click(fn=paraphrase_and_correct, inputs=t2, outputs=result2)