refactor as `LookupError`
Browse files
app.py
CHANGED
@@ -7,7 +7,9 @@ from nltk.tokenize import sent_tokenize
|
|
7 |
|
8 |
from responses import SubmitQuestionAndDocumentsResponse
|
9 |
|
10 |
-
|
|
|
|
|
11 |
nltk.download("punkt")
|
12 |
|
13 |
try:
|
|
|
7 |
|
8 |
from responses import SubmitQuestionAndDocumentsResponse
|
9 |
|
10 |
+
try:
|
11 |
+
_ = nltk.data.find("tokenizers/punkt")
|
12 |
+
except LookupError:
|
13 |
nltk.download("punkt")
|
14 |
|
15 |
try:
|