Phoenix21's picture
downlaoded punkt seperately to handle error
ae6e30d
raw
history blame contribute delete
309 Bytes
import nltk
import os
# Define the path where 'punkt' will be saved
punkt_path = os.path.join('nltk_data', 'tokenizers', 'punkt')
# Create directories if they don't exist
os.makedirs(punkt_path, exist_ok=True)
# Download 'punkt' to the specified directory
nltk.download('punkt', download_dir='nltk_data')