Update src/streamlit_app.py
Browse files- src/streamlit_app.py +11 -1
src/streamlit_app.py
CHANGED
@@ -8,7 +8,17 @@ from nltk import Tree
|
|
8 |
import nltk
|
9 |
|
10 |
# Setup NLTK and benepar
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
benepar.download('benepar_en3')
|
13 |
|
14 |
nlp = spacy.load("en_core_web_sm")
|
|
|
8 |
import nltk
|
9 |
|
10 |
# Setup NLTK and benepar
|
11 |
+
|
12 |
+
# π Set a safe, writable download path
|
13 |
+
nltk_data_path = os.path.join(os.getcwd(), "nltk_data")
|
14 |
+
os.makedirs(nltk_data_path, exist_ok=True)
|
15 |
+
|
16 |
+
# π Download the tokenizer to the safe location
|
17 |
+
nltk.download('punkt', download_dir=nltk_data_path)
|
18 |
+
|
19 |
+
# π Tell NLTK to look here for data
|
20 |
+
nltk.data.path.append(nltk_data_path)
|
21 |
+
|
22 |
benepar.download('benepar_en3')
|
23 |
|
24 |
nlp = spacy.load("en_core_web_sm")
|