Spaces:
Runtime error
Runtime error
Mohammaderfan koupaei
commited on
Commit
·
941a5b8
1
Parent(s):
29a04a9
Add application file
Browse files
app.py
CHANGED
@@ -16,10 +16,23 @@ def main():
|
|
16 |
logging.basicConfig(level=logging.INFO)
|
17 |
logger = logging.getLogger(__name__)
|
18 |
logger.info("Initializing training process...")
|
|
|
19 |
import nltk
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# Ensure NLTK resources are available
|
21 |
-
nltk.download('punkt', quiet=True)
|
22 |
-
nltk.download('stopwords', quiet=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
# Set a random seed for reproducibility
|
24 |
set_seed(42)
|
25 |
|
|
|
16 |
logging.basicConfig(level=logging.INFO)
|
17 |
logger = logging.getLogger(__name__)
|
18 |
logger.info("Initializing training process...")
|
19 |
+
import os
|
20 |
import nltk
|
21 |
+
|
22 |
+
# Set up NLTK data directory
|
23 |
+
nltk_data_path = "./nltk_data"
|
24 |
+
os.makedirs(nltk_data_path, exist_ok=True)
|
25 |
+
nltk.data.path.append(nltk_data_path)
|
26 |
+
|
27 |
# Ensure NLTK resources are available
|
28 |
+
nltk.download('punkt', download_dir=nltk_data_path, quiet=True)
|
29 |
+
nltk.download('stopwords', download_dir=nltk_data_path, quiet=True)
|
30 |
+
|
31 |
+
# Set up logging
|
32 |
+
logging.basicConfig(level=logging.INFO)
|
33 |
+
logger = logging.getLogger(__name__)
|
34 |
+
logger.info("Initializing training process...")
|
35 |
+
|
36 |
# Set a random seed for reproducibility
|
37 |
set_seed(42)
|
38 |
|