Skip to content

Instantly share code, notes, and snippets.

View keithng's full-sized avatar

Keith Ng keithng

View GitHub Profile
@keithng
keithng / ellmer_demo.R
Created January 7, 2026 22:36
Using ellmer to structure parcel legal descriptions
library(tidyverse)
library(ellmer)
#-----------------------------------------------------------------------------#
# Setup
#-----------------------------------------------------------------------------#
system_prompt <- c(
"You are a natural language processing tool for extracting the components of legal appellations for New Zealand parcels, titles and DVR property records.",
"These components are defined in the LINZ cadestral survey guide, and place names are locations in New Zealand.",
"When you are asked to parse legal appellations, extract individual components from each description in the following format:",