Skip to content

Commit

Permalink
app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivmalge authored Dec 28, 2024
1 parent e8a1189 commit 02d4be3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
import nltk
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
import os

# Force NLTK to download resources
nltk_data_dir = os.path.join(os.getcwd(), 'nltk_data')
if not os.path.exists(nltk_data_dir):
os.mkdir(nltk_data_dir)
nltk.data.path.append(nltk_data_dir)

# Download required NLTK resources
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('punkt', download_dir=nltk_data_dir)
nltk.download('stopwords', download_dir=nltk_data_dir)

ps = PorterStemmer()

Expand Down

0 comments on commit 02d4be3

Please sign in to comment.