Skip to content

Commit

Permalink
Update nltk_init_deps.py for ali pr
Browse files Browse the repository at this point in the history
  • Loading branch information
chetanyagoyal authored Sep 18, 2024
1 parent f4e577a commit 15de247
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ def check_and_download_nltk_data(data_name):
"""
try:
nltk.data.find(f"tokenizers/{data_name}")
except LookupError:
#except LookupError:
except Exception:
print(f"{data_name} is not downloaded. Downloading now...")
nltk.download(data_name)
print(f"{data_name} has been downloaded.")


check_and_download_nltk_data("punkt")
check_and_download_nltk_data("punkt_tab")
check_and_download_nltk_data("punkt_tab")
check_and_download_nltk_data("averaged_perceptron_tagger_eng")

0 comments on commit 15de247

Please sign in to comment.