The rise of spatiotemporal data and the need for efficient geospatial modeling have spurred interest in automating these tasks with large language models (LLMs). However, general LLMs often generate errors in geospatial code due to a lack of domain-specific knowledge on functions and operators. To address this, a retrieval-augmented generation (RAG) approach, utilizing an external knowledge base of geospatial functions and operators, is proposed. This study introduces a framework to construct such a knowledge base, leveraging geospatial script semantics. The framework includes: Function Semantic Framework Construction (Geo-FuSE), Frequent Operator Combination Statistics (Geo-FuST), and Semantic Mapping (Geo-FuM). Techniques like Chain-of-Thought, TF-IDF, and the APRIORI algorithm are utilized to derive and align geospatial functions. An example knowledge base, Geo-FuB, built from 154,075 Google Earth Engine scripts, is available on GitHub. Evaluation metrics show a high accuracy, reaching 88.89% overall, with structural and semantic accuracies of 92.03% and 86.79% respectively. Geo-FuB's potential to optimize geospatial code generation through the RAG and fine-tuning paradigms is highlighted.
Mitigating Geospatial Knowledge Hallucination in Large Language Models: Benchmarking and Dynamic Factuality Aligning
College of AI, Tsinghua University(清华大学人工智能学院);Department of Electronic Engineering, BNRist, Tsinghua University(清华大学电子工程系);School of Electronic and Information Engineering, Beijing Jiaotong University(北京交通大学电子信息学院);Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系)
GeoJSEval: An Automated Evaluation Framework for Large Language Models on JavaScript-Based Geospatial Computation and Visualization Code Generation
School of Resource and Environmental Sciences, Wuhan University(武汉大学资源与环境科学学院);State Key Laboratory of Information Engineering in Surveying Mapping and Remote Sensing, Wuhan University(武汉大学测绘遥感信息工程国家重点实验室);School of Remote Sensing and Information Engineering, Wuhan University(武汉大学遥感信息工程学院)
Evaluation of Code LLMs on Geospatial Code Generation
Wrocław University of Science and Technology(弗罗茨瓦夫理工大学);INESC-ID;LUMLIS (Lisbon ELLIS Unit)(LUMLIS(里斯本ELLIS单元));Instituto Superior Técnico(高等技术学院);University of Lisbon(里斯本大学)
AutoGEEval++: A Multi-Level and Multi-Geospatial-Modality Automated Evaluation Framework for Large Language Models in Geospatial Code Generation on Google Earth Engine