All posts tagged with 'LLMs'
Fine-tuning a DistilBERT classifier with numerical and text inputs
Text classification is often done through fine-tuning of a pretrained foundation model with domain-specific data. In FreeAgent we use transformer based models to automatically classify incoming bank transactions. Specifically we use a DistilBERT model that is fine-tuned on hundreds of millions of bank transactions with customer-labelled accounting categories.
The model inputs are currently text-based, built from a combination of bank transaction descriptions and amounts.
In this post we describe an approach to fine-tuning the DistilBERT model and training the classifier including the numerical amount feature as a single network. Continue reading
Structured outputs with Pydantic AI
One of the challenges of working with LLMs is getting them to respond with a consistent format, such as a given JSON schema. Anyone who has tried to solve this issue with prompt engineering knows how frustrating it can be. You add a ‘MUST’ here and an ‘always return JSON’ there, but still the output doesn't reliably parse. Maybe you're about to add a try-except block to handle parsing errors… Continue reading