AI Document Extractor

Project Duration: 2 Days
Environment setup visualization

Problem

A travel company offers a wide variety of packages to their clients. To present these offerings in a standardized format, they need to extract pricing information from thousands of suppliers. The suppliers provide these offerings in custom PDFs, requiring staff to manually update the information. This is time-consuming, leads to the staff skipping low-volume packages, and results in delays when updating offerings.

Environment setup visualization

Ideal Solution

The ideal solution would be easy to use by the staff, able to auto scale up/down to meet demand, accurately extract the information, and able to export the data directly into the CRM system. This would result in a 10x increase in the speed of updating offerings and remove any backlogs.

Environment setup visualization

Approaches

I approached the problem with 3 distinct approaches:

  • 1. Single Shot: Take in the PDF and process it in one step
  • 2. Break PDF: Break the PDF into pages
  • 3. PDF to Text: Extract the text from the PDF for processing
Environment setup visualization

1. Single Shot

""

Initially, I tested an approach where I used AI to extract the information in one shot. However, this method quickly ran into issues. The PDFs were too long to process, and even when I could load them (e.g., using "NoteBookLM"), the output lacked control and precision.

Environment setup visualization

2. Break PDF into Images

Next, I tried breaking the PDF into parts and processing it as images. While this solved some of the size issues, it lost context when pricing information spanned multiple pages, leading to incomplete or disjointed data extraction.

Environment setup visualization

3. Text Extraction with Structured Output

The final and most effective approach involved extracting the text and summarizing it to fit into the context window, removing unnecessary information. I then used OpenAI’s latest structured output capabilities to generate a well-organized table of pricing data, which could be imported directly into their CRM system. This method provided the control and structure the company needed.

Environment setup visualization

UI & Conclusion

This project highlighted how AI can be applied to automate and streamline business processes. AI will increasingly be integrated into organizations, making their workflows more efficient and reducing the burden of manual tasks that add little value to the customer.

Environment setup visualization

Notes

The project was developed on the Modal platform, which has become my go-to tool. It’s incredibly easy to build, deploy, and scale, and I’m a customer for life!