Retrieval-Augmented Generation (RAG) för automatisering av jordbruksblockannoteringar : AI-driven bearbetning av strukturerad text och gränsdata för generering av beskrivande kommentarer
Manual annotation of agricultural block boundary modifications is a time-consuming task often prone to inconsistency and administrative inefficiency. This thesis investigates how retrieval-augmented generation (RAG) can be used to automate the generation of internal annotations (noteringar) based on structured spatial and administrative data from Jordbruksverket’s Basen system. The purpose was to evaluate whether AI-generated comments could align with human-written annotations in both tone and content, and whether such a system could reduce the burden of manual documentation in public administration workflows. A microservice architecture was developed, integrating PostgreSQL, FastAPI, and RAGnar—a retrieval system used to dynamically query historical block data. Structured prompts were constructed using fields such as status, granskorsak, area_difference, and direction_change, and passed into a locally hosted LLaMA 3 language model to generate descriptive annotations. Evaluation was per- formed using BERTScore to measure semantic similarity between the AI-generated and human written annotations across 1,974 matched pairs. Results showed an average BERTScore F1 of 0.6594, indicating moderate semantic overlap. A deeper qualitative comparison revealed that the system performed well in routine cases involving spatial changes and area updates, while struggling with annotations requiring legal reasoning, policy references, or context not captured in structured metadata. The findings suggest that while the method does not fully replace expert judgment, it can support case officers by generating draft annotations that follow institutional tone and format. This contributes to increased standardization, improved traceability, and potential time savings in annotation workflows. The approach may also be applicable in other domains that rely on structured spatial data and formaldocumentation, such as urban planning and environmental regulation.
Publication Details
- Journal
- Jonkoping University Library (Jönköping University)
- Published
- 2025-01-01
- Primary Topic
- Geographic Information Systems Studies
- Type
- article
- Field-Weighted Citation Impact
- 0.00