Quest1
AI/ML

From Contracts to Code — AI-Powered Information Extraction

An intern’s walkthrough of using LLMs to automate contract data extraction in transport & logistics — turning unstructured PDFs into structured digitized data, and what it took to get there.

AIinformation extractionlogisticsLLMGenAIinternship


Understanding the Business domain and problem

In the Transport and Logistics Management (TLM) ecosystem, there are enterprises that play the role of intelligent intermediaries and orchestrators between shippers (like manufacturers or retailers) and carriers (like FedEx, Blue Dart, DHL, etc.). Their goal is to optimize the movement of goods across the supply chain using technology, data, and partnerships, by offering the best options for optimized movements of shipments (both from a cost and efficiency perspective).

I was presented with a genuine and intricate problem at Quest1. Large carriers do business through contracts — many of them — established with the intermediaries and orchestrators and these contracts are typically received in an unstructured PDF format, even scanned images of documents sometimes.

In the absence of an established set of standards and/or ontology governing the TLM space, this makes the ingestion of contractual data (fuel surcharges, accessorial fees, rate sheets, product classifications, and more) extremely challenging.

For the orchestrators, manually processing each contract and extracting relevant business rules and fields for digitization, on an average, could take about 2–3 weeks before uploading them into their own internal systems. Consequently the turn-around time for an orchestrator/intermediary to onboard a carrier roughly takes about 2–3 weeks, before they can start making their systems and services usable for consumption by shippers and carriers.

My internship objective? Explore automation of the contractual data extraction process with AI, specifically using Large Language Models (LLMs).

Getting Oriented: Templates, Contracts, and Terminology

I began all this with the help of Quest1. I quickly learned about the work and a milestone plan that enabled me to track progress and objectives.

I was given several .xlsx templates mimicking data from various logistics companies with tabs like FSC (Fuel Surcharge), Rate Sheet, Agreement Metadata, Area, Product Classification and Accessorial Charges. These .xlsx templates represented (aspirationally) the superset of data that can potentially be extracted from various contracts, with the intent of final digitization.

I was also provided with four sample PDFs each of contracts for different carrier companies. All the PDFs comprised of contractual information covering different aspects of Transport Logistics and Management. With that, I was given links and descriptions mapping each PDF to its respective Excel version. The Excel version was essentially a representation of how a TLM analyst inputs the multitude of data from various contracts into a structured .xlsx file, before importing the said data into a TLM system.

I used this as my starting point and went back to tools such as NotebookLM, ChatGPT, tutorials online, and videos in order to begin to learn. I paid particular attention not only to the structure but also to the vocabulary of logistics contracts, which differed in companies and documents.

One-Way Linking: PDFs to Excel Mapping

After I established a solid foundation, I proceeded to develop my understanding by conducting a one-way comparison between the PDFs and the Excel templates.

The objective was to determine:

•What fields are present in both the PDF and Excel

•What was partly present

•What was entirely absent

To achieve this, I applied NotebookLM to verify if each variable was present within the PDFs. When the match was not complete, I indicated it as “P” for partial. Doing this provided us with a real-world picture of what could be automatically extracted, what fields would require special treatment, and where differences existed between contracts.

Constructing the Extraction Pipeline

Having structure and expectations defined, I began constructing the automation system’s core.


Reflections and Takeaways

This internship was not about simply creating a script — it was about addressing a real-world problem with dirty, inconsistent data and developing a method to infuse structure and efficiency using AI.

Here’s what I learned from the experience:

•Understanding the domain is important — you can’t make what you don’t know

•Preprocessing and postprocessing are as critical as model calls

•Prompt engineering contributes a lot to obtaining correct LLM results

•Creating scalable, reusable data structures saves a huge amount of future work

References

\[1\] Google Gemini — https://deepmind.google/technologies/gemini/

\[2\] OpenAI GPT-4 — https://openai.com/chatgpt/overview/

\[3\] NotebookLM by Google Labs — https://notebooklm.google

\[4\] Unstructured.io — https://docs.unstructured.io/

\[5\] Tesseract OCR — https://github.com/tesseract-ocr/tesseract

Acknowledgements

Big thanks to Quest1 for giving me this opportunity and for all the support along the way. I’d especially like to thank Sirisha Pydimarri for her constant guidance and encouragement throughout the internship and Vishy Iyer for helping me align with the expected schema and guide me to overcome hurdles.

I could only manage to achieve this due to their constant support — they made sure I had a productive and inspiring environment, which actually encouraged me to perform at my best.

About Me

I’m Amogh Sriman Kalingarayar, a student currently pursuing a Bachelor’s degree in Data Science & AI at Nanyang Technological University (NTU) Singapore.

I’m passionate about solving real-world problems using machine learning, automation, and structured thinking. This project at Quest1 gave me the opportunity to explore how AI — especially LLMs — can turn unstructured logistics contracts into structured, usable data. It also deepened my interest in document intelligence and practical applications of NLP.

Aside from this, I’ve implemented full-stack systems such as Report Quest, created transportation network forecasting models, designed relational databases with MySQL and Azure, and established analytical pipelines with R. I like to bring technical depth together with imagination to create things that function and drive business solutions.

You can find more of my work on GitHub: https://github.com/Mogaa32

My Linkedin: https://www.linkedin.com/in/amogh-sriman-kalingarayar-90042432a/

AS
Amogh Sriman Kalingarayar
Author · Quest1
echo "let's connect"

Have a perspective of your own?

We'd like to hear how you're thinking about AI, data, and the architecture decisions that matter.