Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +3 -15
src/streamlit_app.py
CHANGED
@@ -1,25 +1,13 @@
|
|
1 |
|
2 |
-
# import nltk
|
3 |
-
# import os
|
4 |
-
|
5 |
-
# # Set local download directory (inside Hugging Face's writable space)
|
6 |
-
# nltk_data_dir = os.path.join(os.path.dirname(__file__), "nltk_data")
|
7 |
-
|
8 |
-
# # Download punkt tokenizer to local path
|
9 |
-
# nltk.download("punkt", download_dir=nltk_data_dir)
|
10 |
-
|
11 |
-
# # Set the path for NLTK to find data
|
12 |
-
# nltk.data.path.append(nltk_data_dir)
|
13 |
-
|
14 |
import streamlit as st
|
15 |
import tensorflow as tf
|
16 |
import numpy as np
|
17 |
import re
|
18 |
import nltk
|
19 |
|
20 |
-
#
|
21 |
-
|
22 |
-
|
23 |
|
24 |
model = tf.keras.models.load_model('src/my_distilbert_classifier.keras')
|
25 |
|
|
|
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import streamlit as st
|
3 |
import tensorflow as tf
|
4 |
import numpy as np
|
5 |
import re
|
6 |
import nltk
|
7 |
|
8 |
+
# Ensure NLTK sentence tokenizer is available
|
9 |
+
nltk.download('punkt')
|
10 |
+
from nltk.tokenize import sent_tokenize
|
11 |
|
12 |
model = tf.keras.models.load_model('src/my_distilbert_classifier.keras')
|
13 |
|