Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
nltk
Browse filesSigned-off-by: peter szemraj <peterszemraj@gmail.com>
app.py
CHANGED
@@ -34,9 +34,12 @@ from utils import load_example_filenames, saves_summary, truncate_word_count
|
|
34 |
|
35 |
_here = Path(__file__).parent
|
36 |
|
37 |
-
os.environ["NLTK_DATA"] = str(_here / "nltk_data")
|
38 |
-
nltk.download("punkt", force=True,
|
39 |
-
nltk.download(
|
|
|
|
|
|
|
40 |
|
41 |
|
42 |
MODEL_OPTIONS = [
|
|
|
34 |
|
35 |
_here = Path(__file__).parent
|
36 |
|
37 |
+
# os.environ["NLTK_DATA"] = str(_here / "nltk_data")
|
38 |
+
nltk.download("punkt", force=True, quiet=True)
|
39 |
+
nltk.download(
|
40 |
+
"popular",
|
41 |
+
force=True,
|
42 |
+
)
|
43 |
|
44 |
|
45 |
MODEL_OPTIONS = [
|
utils.py
CHANGED
@@ -4,17 +4,24 @@
|
|
4 |
|
5 |
import re
|
6 |
import subprocess
|
|
|
7 |
from datetime import datetime
|
|
|
8 |
from pathlib import Path
|
|
|
9 |
|
|
|
10 |
import torch
|
11 |
from natsort import natsorted
|
12 |
-
from
|
13 |
from nltk.tokenize import sent_tokenize, word_tokenize
|
14 |
-
from itertools import combinations
|
15 |
-
from collections import defaultdict
|
16 |
from rapidfuzz import fuzz
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
def validate_pytorch2(torch_version: str = None):
|
|
|
4 |
|
5 |
import re
|
6 |
import subprocess
|
7 |
+
from collections import defaultdict
|
8 |
from datetime import datetime
|
9 |
+
from itertools import combinations
|
10 |
from pathlib import Path
|
11 |
+
from typing import List
|
12 |
|
13 |
+
import nltk
|
14 |
import torch
|
15 |
from natsort import natsorted
|
16 |
+
from nltk.corpus import stopwords
|
17 |
from nltk.tokenize import sent_tokenize, word_tokenize
|
|
|
|
|
18 |
from rapidfuzz import fuzz
|
19 |
+
|
20 |
+
nltk.download("punkt", quiet=True)
|
21 |
+
nltk.download(
|
22 |
+
"popular",
|
23 |
+
quiet=True,
|
24 |
+
)
|
25 |
|
26 |
|
27 |
def validate_pytorch2(torch_version: str = None):
|