Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 175 Bytes
9781b82 |
1 2 3 |
def chunk_text(text: str, chunk_size: int = 15) -> list[str]:
words = text.split()
return [' '.join(words[i:i + chunk_size]) for i in range(0, len(words), chunk_size)] |