Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ try: nltk.data.find('tokenizers/punkt')
|
|
| 52 |
except LookupError:
|
| 53 |
logging.info("NLTK 'punkt' tokenizer not found. Downloading..."); nltk.download('punkt', quiet=True); logging.info("'punkt' downloaded successfully.")
|
| 54 |
|
| 55 |
-
def split_by_punctuation(text: str, max_len: int =
|
| 56 |
# (此函数不变)
|
| 57 |
fragments = re.split(r'([,.:;!?。,、;:!?.…【】])', text); sentences = []
|
| 58 |
temp_frag = ""
|
|
|
|
| 52 |
except LookupError:
|
| 53 |
logging.info("NLTK 'punkt' tokenizer not found. Downloading..."); nltk.download('punkt', quiet=True); logging.info("'punkt' downloaded successfully.")
|
| 54 |
|
| 55 |
+
def split_by_punctuation(text: str, max_len: int = 20):
|
| 56 |
# (此函数不变)
|
| 57 |
fragments = re.split(r'([,.:;!?。,、;:!?.…【】])', text); sentences = []
|
| 58 |
temp_frag = ""
|