Spaces:
Running
Running
Update functions_preprocess.py
Browse files- functions_preprocess.py +3 -0
functions_preprocess.py
CHANGED
|
@@ -20,6 +20,9 @@ import torch.optim as optim
|
|
| 20 |
import torch.nn.functional as F
|
| 21 |
from torchtext.data.utils import get_tokenizer
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
def download_if_non_existent(res_path, res_name):
|
| 24 |
try:
|
| 25 |
nltk.data.find(res_path)
|
|
|
|
| 20 |
import torch.nn.functional as F
|
| 21 |
from torchtext.data.utils import get_tokenizer
|
| 22 |
|
| 23 |
+
stop_words = set(stopwords.words('english'))
|
| 24 |
+
lemmatizer = WordNetLemmatizer()
|
| 25 |
+
|
| 26 |
def download_if_non_existent(res_path, res_name):
|
| 27 |
try:
|
| 28 |
nltk.data.find(res_path)
|