- GPT3's API has an upper limit on the amount of text you can send it to summarize at any given instance.
- This code sends one page at a a time to GPT3 and usually comes in under the cap (but if one page is too dense it will return an error).
- Obviously there are limitations here, for example, paragraphs that bleed from one page to another.
- Use the python file and make sure you have the right libraries installed.
- You'll need OpenAI's library and PyPDF2 (use the PIP install command for both, or you can ask chat.openai.com for step by step instructions).
- You'll need to get your API key from OpenAI (again, ask chat GPT how to do that).
- You can change the file name reference in the code or rename your file to "target.pdf".
- The output is both displayed on screen and printed to "summaries.txt"
There are probably more elegant ways to create summaries from long PDFs, so if you have them, please share!