sashtech commited on
Commit
d3c4b21
·
verified ·
1 Parent(s): d3dd526

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -11
app.py CHANGED
@@ -6,7 +6,6 @@ import subprocess
6
  import nltk
7
  from nltk.corpus import wordnet
8
  from gensim import downloader as api
9
- from textblob import TextBlob
10
 
11
  # Ensure necessary NLTK data is downloaded
12
  nltk.download('wordnet')
@@ -97,21 +96,13 @@ def paraphrase_with_spacy_nltk(text):
97
 
98
  return corrected_text
99
 
100
- # Function to correct grammar using TextBlob
101
- def correct_grammar(text):
102
- blob = TextBlob(text)
103
- return str(blob.correct())
104
-
105
- # Combined function: Paraphrase -> Capitalization -> Grammar Correction
106
  def paraphrase_and_correct(text):
107
  # Step 1: Paraphrase the text
108
  paraphrased_text = paraphrase_with_spacy_nltk(text)
109
 
110
  # Step 2: Capitalize sentences and proper nouns
111
- capitalized_text = capitalize_sentences_and_nouns(paraphrased_text)
112
-
113
- # Step 3: Correct grammar
114
- final_text = correct_grammar(capitalized_text)
115
 
116
  return final_text
117
 
 
6
  import nltk
7
  from nltk.corpus import wordnet
8
  from gensim import downloader as api
 
9
 
10
  # Ensure necessary NLTK data is downloaded
11
  nltk.download('wordnet')
 
96
 
97
  return corrected_text
98
 
99
+ # Combined function: Paraphrase -> Capitalization
 
 
 
 
 
100
  def paraphrase_and_correct(text):
101
  # Step 1: Paraphrase the text
102
  paraphrased_text = paraphrase_with_spacy_nltk(text)
103
 
104
  # Step 2: Capitalize sentences and proper nouns
105
+ final_text = capitalize_sentences_and_nouns(paraphrased_text)
 
 
 
106
 
107
  return final_text
108