Inspiration
I am taking AP World History this year, and in the class, we have to read lengthy chapters from the textbook and take notes on them. It was very time-consuming for me, so I coded a program to summarize each page for me.
What it does
The program runs in the terminal. It takes a pdf for input and summarizes it into a text document. Optionally, it converts the summarized text into speech and saves it to a file.
How I built it
It uses argparse for command line arguments. The user provides the PDF file name through it. Then, using ocrmypdf, it adds text "layers" to the pdf, which is read by PyPDF. Using OpenAI API, it summarizes the lengthy text into concise paragraphs. Then it writes it into the user-provided text file or the default file output.txt. If the user wants it as an audio file, then using gtts makes it an audio file.
Challenges I ran into
Organizing my code for readability and figuring out how to effectively utilize OpenAI.
Accomplishments that I'm proud of
This project was my first time utilizing AI and new libraries like argparser, pypdf, and gtts. Each had its unique challenges, but I pulled through. I am definitely going to add more features, maybe a GUI?
What I learned
I learned to effectively read new libraries' documentation and explore multiple conventions for common problems.
What's next for PDF Summarizer
I plan on making a GUI for it using a drag-and-drop feature. Additionally, it's going to support multiple types of files.
Built With
- openai
- python
Log in or sign up for Devpost to join the conversation.