diff options
Diffstat (limited to 'server.py')
| -rwxr-xr-x | server.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server.py b/server.py index ad8c29d..868572e 100755 --- a/server.py +++ b/server.py @@ -103,6 +103,14 @@ def get_sentences_from_file(file_path, gene_name, category_name=None): nltk.data.path.append("./nlp/") +# Validate punkt tokenizer is available +try: + nltk.data.find('tokenizers/punkt') +except LookupError: + print("ERROR: NLTK punkt tokenizer not found. Set NLTK_DATA or install punkt data.") + print(" NLTK data paths: " + str(nltk.data.path)) + raise SystemExit(1) + # Initialize database within application context with app.app_context(): db.create_all() |
