ITADN

Replace deprecated punkt with punkt_tab in NLTK downloader task

#273ClosedTealk 创建于 2025-12-11
T
Tealkcommented
The current NLTK downloader task in `tasks/paperless_ngx/nltk.yml` downloads the deprecated `punkt` package, which causes `punkt_tab` resource errors in Paperless-NGX 2.11.6+. **Error:** ``` Resource [93mpunkt_tab [0m not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('punkt_tab') ``` ### Root Cause As of NLTK 3.8.2, the `punkt` package has been deprecated and replaced with `punkt_tab` due to security concerns with unsafe pickles. The current Ansible task downloads the old `punkt` package, but modern versions of Paperless-NGX require `punkt_tab` for tokenization. ### Solution Replace the `punkt` downloader command with `punkt_tab` in line 21 of `tasks/paperless_ngx/nltk.yml`: https://github.com/paperless-ngx/ansible/blob/e9a333643a5f59e92edf12c7202ca68d49844f7b/tasks/paperless_ngx/nltk.yml#L21 ### References - NLTK deprecation: https://github.com/nltk/nltk/issues/3293 - Paperless-NGX issue: https://github.com/paperless-ngx/paperless-ngx/issues/7530
关闭于 2026-01-01 1 条评论