df-gan-text-to-image / nltk_setup.py
sohanAI's picture
Upload 7 files
78cabf4 verified
raw
history blame contribute delete
483 Bytes
import nltk
import os
# Make sure NLTK data directory exists
nltk_data_dir = os.path.expanduser('~/nltk_data')
os.makedirs(nltk_data_dir, exist_ok=True)
# Check if punkt tokenizer already exists
punkt_dir = os.path.join(nltk_data_dir, 'tokenizers', 'punkt')
if not os.path.exists(punkt_dir):
print("Downloading NLTK punkt tokenizer...")
nltk.download('punkt', quiet=False)
else:
print("NLTK punkt tokenizer already exists")
print("NLTK setup complete")