# Creating AI Based Document Splitter

**URL:** <https://community.openai.com/t/creating-ai-based-document-splitter/924267>\
**Category:** API\
**Tags:** pdf, multimodal, gpt-4o\
**Created:** [August 27, 2024, 10:43pm UTC](https://community.openai.com/t/creating-ai-based-document-splitter/924267 "2024-08-27T22:43:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![36e83c73e2991ae8355b](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/36e83c73e2991ae8355b/32/452174_2.png) [@36e83c73e2991ae8355b](https://community.openai.com/u/36e83c73e2991ae8355b)\
**Post date:** [August 27, 2024, 10:43pm UTC](https://community.openai.com/t/creating-ai-based-document-splitter/924267/1 "2024-08-27T22:43:56Z")

</div>

Hello Community,

I have encountered a dilemma and would greatly appreciate your insights. I am currently developing a document analyzer and have made good progress, but I am facing a challenge with a specific feature. For the past two weeks, I have been struggling to define the boundaries of individual documents within a combined PDF, which includes contracts, emails, reports, and more. My goal is to create a script that utilizes the OpenAI API to split these documents into sub-documents. However, I am finding it difficult to accurately define each document boundary using the GPT-4o API, especially since I need to pass the pages as images to the API due to various reasons.

My current approach involves passing the pages one by one to the API until it outputs a JSON body with a “result: true,” indicating that I should proceed with splitting the document. At this point, I create a new document containing all the previous pages. While this approach has taken me halfway, I am still encountering inconsistent results. I would greatly appreciate any advice or suggestions you may have on this matter.

P.S. of course I tried with the tempreture=0 and top\_p=100 and other various solutions that exist on the internet but didn’t work for me

Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![sergeliatko](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/sergeliatko/32/816_2.png) [@sergeliatko](https://community.openai.com/u/sergeliatko)\
**Post date:** [August 27, 2024, 11:20pm UTC](https://community.openai.com/t/creating-ai-based-document-splitter/924267/2 "2024-08-27T23:20:24Z")

</div>

Hi, I had a similar issue s while ago, solved it finally. See some examples (check the structure.json for the document structure ready to be split into subsections) here: [SIMANTIKS API Examples - Business Associate Agreement (fake personal data used in this example). · GitHub](https://gist.github.com/sergeliatko/73a24e664d72ded53540680632309c19)

Let me know if that’s what you’re trying to achieve.

---

<div class="post-metadata">

**Author:** ![36e83c73e2991ae8355b](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/36e83c73e2991ae8355b/32/452174_2.png) [@36e83c73e2991ae8355b](https://community.openai.com/u/36e83c73e2991ae8355b)\
**Post date:** [August 28, 2024, 1:31pm UTC](https://community.openai.com/t/creating-ai-based-document-splitter/924267/3 "2024-08-28T13:31:09Z")

</div>

Hi Sergeliatko,

Thanks for your response. Sadly this is not what I’m looking for since I’m passing images to the API and I don’t want to make it a text in order to split the original page later.

---

<div class="post-metadata">

**Author:** ![sergeliatko](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/sergeliatko/32/816_2.png) [@sergeliatko](https://community.openai.com/u/sergeliatko)\
**Post date:** [August 28, 2024, 1:56pm UTC](https://community.openai.com/t/creating-ai-based-document-splitter/924267/4 "2024-08-28T13:56:45Z")

</div>

Ok, thanks for letting me know.
