#13 修正该错误
This commit is contained in:
@@ -45,11 +45,11 @@
|
|||||||
```bash
|
```bash
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
3. (可选)若需要手动安装 `nltk` 的 `punkt` 数据包:
|
3. (可选)若需要手动安装 `nltk` 的 `punkt_tab` 数据包:
|
||||||
```bash
|
```bash
|
||||||
python
|
python
|
||||||
>>> import nltk
|
>>> import nltk
|
||||||
>>> nltk.download('punkt')
|
>>> nltk.download('punkt_tab')
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
+1
-1
@@ -583,7 +583,7 @@ def advanced_split_content(content: str,
|
|||||||
"""
|
"""
|
||||||
将文本先按句子切分,然后根据语义相似度进行合并,最后根据max_length进行二次切分。
|
将文本先按句子切分,然后根据语义相似度进行合并,最后根据max_length进行二次切分。
|
||||||
"""
|
"""
|
||||||
nltk.download('punkt', quiet=True) # 确保 punkt 数据可用
|
nltk.download('punkt_tab', quiet=True)
|
||||||
sentences = nltk.sent_tokenize(content)
|
sentences = nltk.sent_tokenize(content)
|
||||||
|
|
||||||
if not sentences:
|
if not sentences:
|
||||||
|
|||||||
Reference in New Issue
Block a user