I was testing on a very simple text pdf file that I generated on my own.
This was the text that was generated from pdfParse:
Application for Renovation Works
To : Condominium Manager
Part 1 : To be completed by Subsidiary Proprietor / Tenant
Unit #12-32 Apartment 123
I / We hereby authorised our Contractor __Company name / Mike of Design Company XYZ to
undertake our renovation works at our above premises commencing from 10 June 2026 to 12
June 2026 .
Telephone: +1 4282819283
Part 1 : To be completed by Subsidiary Proprietor / Tenant
Unit #12-32 Apartment 123
I / We hereby authorised our Contractor Company name / Carpenter Company ABC to
undertake our renovation works at our above premises commencing from 16 June 2026 to 18
June 2026 .
Telephone: +1 4282819283
Using the llama-3.1-8b-instant model, the output was:
result {
calendar_items: [
{
start_date_time: '2024-06-10T00:00:00Z',
end_date_time: '2024-06-12T00:00:00Z',
estimated_duration: 1440,
title: 'Renovation Works',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
},
{
start_date_time: '2024-06-16T00:00:00Z',
end_date_time: '2024-06-18T00:00:00Z',
estimated_duration: 1440,
title: 'Renovation Works',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
}
]
}
This was not acceptable with the year being totally wrong.
Updating the model to llama-3.3-70b-versatile, the response looked much better:
result {
calendar_items: [
{
start_date_time: '2024-06-10T00:00:00Z',
end_date_time: '2024-06-12T00:00:00Z',
estimated_duration: 1440,
title: 'Renovation Works',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
},
{
start_date_time: '2024-06-16T00:00:00Z',
end_date_time: '2024-06-18T00:00:00Z',
estimated_duration: 1440,
title: 'Renovation Works',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
}
]
}
However, when I used llama-3.1-8b-instant and updated the prompt to be more concise for extracting events and explicitly mentioned not to change the dates, it actually worked better than llama-3.1-8b-instant with the following response:
result {
calendar_items: [
{
start_date_time: '2026-06-10T00:00:00',
end_date_time: '2026-06-12T00:00:00',
estimated_duration: 0,
title: 'Renovation — Design Company XYZ',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
},
{
start_date_time: '2026-06-16T00:00:00',
end_date_time: '2026-06-18T00:00:00',
estimated_duration: 0,
title: 'Renovation — Carpenter Company ABC',
description: 'Unit #12-32 Apartment 123',
contact_number: '+1 4282819283'
}
]
}
Cleaned up the UI a little to allow deleting of events as well and added an accordion style component so we can expand and collapse each event.
Also tested with a document with multiple events and it worked pretty well!
Here's what it looks like now!
I also hosted it on a subdomain https://calai.elenachoo.com/