用15万条地理代码构建知识库,让大模型生成更准的地理分析代码。
Geo-FuB: A Method for Constructing an Operator-Function Knowledge Base for Geospatial Code Generation Tasks Using Large Language Models
- 基于地理代码语义构建函数与操作符知识库
- 在15.4万条脚本上实现88.89%整体准确率
- 适合需要精准地理代码生成的研究者使用
时空数据激增推动了地理空间建模自动化的需求,但通用大语言模型因缺乏地理领域知识常生成错误代码。为此,本文提出一种检索增强生成(RAG)方法,利用外部地理函数与操作符知识库。研究构建了包含函数语义框架(Geo-FuSE)、频繁操作符组合统计(Geo-FuST)和语义映射(Geo-FuM)的框架,结合思维链、TF-IDF与APRIORI算法提取并对齐地理函数。基于154,075条Google Earth Engine脚本构建的开源知识库Geo-FuB,在评估中达到88.89%的整体准确率,结构与语义准确率分别为92.03%和86.79%。该知识库可支持RAG与微调范式,显著提升地理代码生成质量。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。