# Generating paragraphs from a text file

**URL:** <https://discuss.huggingface.co/t/generating-paragraphs-from-a-text-file/48637>\
**Category:** Beginners\
**Created:** [July 29, 2023, 4:54pm UTC](https://discuss.huggingface.co/t/generating-paragraphs-from-a-text-file/48637 "2023-07-29T16:54:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![morgenly](https://avatars.discourse-cdn.com/v4/letter/m/ebca7d/32.png) [@morgenly](https://discuss.huggingface.co/u/morgenly)\
**Post date:** [July 29, 2023, 4:54pm UTC](https://discuss.huggingface.co/t/generating-paragraphs-from-a-text-file/48637/1 "2023-07-29T16:54:30Z")

</div>

I have a text file input.txt with 20 pages of nothing but sentences, without any line spaces. How can I automate grouping these sentences into meaning paragraphs?

---

<div class="post-metadata">

**Author:** ![dblakely](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dblakely](https://discuss.huggingface.co/u/dblakely)\
**Post date:** [August 1, 2023, 5:57pm UTC](https://discuss.huggingface.co/t/generating-paragraphs-from-a-text-file/48637/2 "2023-08-01T17:57:38Z")

</div>

I would either just do this by hand (tedious but wouldn’t take long) or use the ChatGPT API - chunk the txt file into inputs that fit within ChatGPT’s context window and for each chunk, call ChatGPT asking it to do its best to break the sentence into reasonable paragraphs. Then combine everything ChatGPT sends back to you.
