Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 '
|
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=
|
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)
|