From ed7e74583d4ca661e8828efd1641ebbc174b111f Mon Sep 17 00:00:00 2001 From: YILING0013 Date: Sat, 1 Feb 2025 10:20:40 +0800 Subject: [PATCH] =?UTF-8?q?#13=20=E4=BF=AE=E6=AD=A3=E8=AF=A5=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- novel_generator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc85b5f..41ec5bd 100644 --- a/README.md +++ b/README.md @@ -45,11 +45,11 @@ ```bash pip install -r requirements.txt ``` -3. (可选)若需要手动安装 `nltk` 的 `punkt` 数据包: +3. (可选)若需要手动安装 `nltk` 的 `punkt_tab` 数据包: ```bash python >>> import nltk - >>> nltk.download('punkt') + >>> nltk.download('punkt_tab') ``` --- diff --git a/novel_generator.py b/novel_generator.py index dd02e31..779b509 100644 --- a/novel_generator.py +++ b/novel_generator.py @@ -583,7 +583,7 @@ def advanced_split_content(content: str, """ 将文本先按句子切分,然后根据语义相似度进行合并,最后根据max_length进行二次切分。 """ - nltk.download('punkt', quiet=True) # 确保 punkt 数据可用 + nltk.download('punkt_tab', quiet=True) sentences = nltk.sent_tokenize(content) if not sentences: