Method and system for implementing GIS software interaction based on large language model
Patent Information
- Application Number
- CN202510687371.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-05-27
AI Technical Summary
[0004]本申请提供一种基于大语言模型的GIS软件交互实现方法及系统,以解决现有GIS软件要求用户具备较高的技术水平,使用门槛高,GIS技术普及和应用难度大的问题
[0044] (1) Lowering the barrier to entry: Users do not need to master GIS terminology and complex operation instructions; they can complete tasks through natural language.
Smart Images

Figure CN120780722B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geographic information processing technology, specifically to a method and system for implementing GIS software interaction based on a large language model. Background Technology
[0002] Geographic Information System (GIS) software, such as ArcGIS and QGIS, is widely used in spatial analysis, cartography, and geographic data management. However, these tools typically have complex interfaces and highly specialized functions, requiring users to possess a high level of technical expertise. This not only necessitates users' mastery of numerous technical terms and complex commands but also increases the difficulty of popularizing and applying GIS technology.
[0003] In recent years, the emergence and development of large language models (such as ChatGPT) have demonstrated powerful natural language processing capabilities. These models can understand users' needs described in natural language and generate corresponding solutions. Combining large language models with GIS software allows users to interact with the software through natural language, thereby simplifying the operation process, lowering the barrier to entry, and promoting the popularization of GIS technology. Summary of the Invention
[0004] This application provides a method and system for implementing GIS software interaction based on a large language model, in order to solve the problems that existing GIS software requires users to have a high level of technical expertise, has a high barrier to entry, and is difficult to popularize and apply GIS technology.
[0005] According to the first aspect, one embodiment provides a method for implementing GIS software interaction based on a large language model, the method comprising:
[0006] Step S1: Obtain the GIS task requirement text input by the user;
[0007] Step S2: Based on the large language model, the required text is preprocessed, the preprocessed text is classified into intents and parameters are extracted, and the extracted intents and parameters are converted into operation instructions that can be executed by GIS software.
[0008] Step S3: Send the obtained operation instructions to the GIS software for execution, obtain the execution results from the GIS software, and provide feedback to the user.
[0009] Further, step S2 specifically includes:
[0010] Step S21, text preprocessing, includes:
[0011] Step S211: Based on the constructed stop word list, remove stop words from the input text;
[0012] Step S212: Perform character normalization processing on the text.
[0013] Further, step S2 specifically includes:
[0014] Step S22, Intent Classification, includes:
[0015] Step S221: Define all GIS tasks as intent label sets. Each intent label I i This represents a GIS data processing method;
[0016] Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label.
[0017] Step S223: Calculate the probability of all possible intent labels using the large language model, and select the intent label with the highest probability, which is the most likely intent I corresponding to the preprocessed text.
[0018] Further, step S2 specifically includes:
[0019] Step S23, parameter extraction, includes:
[0020] Rule-based parameter extraction includes parameter extraction using predefined rules and templates;
[0021] Parameter extraction based on large language models, including automatic parameter extraction using large language models;
[0022] Hybrid parameter extraction that integrates rule extraction and large language model extraction includes combining and complementing rule-based extraction and large language model-based extraction.
[0023] Further, step S2 specifically includes:
[0024] Step S24, instruction conversion based on GIS mapping rules, includes:
[0025] Step S241, Rule matching: Based on the predefined mapping rule set F map Its form is: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}, where I i Indicates intention, g i This corresponds to the GIS function; when the intent I parsed from the preprocessed text exists in F map In the middle, the corresponding GIS function is found through direct matching: g = F map(I);
[0026] Step S242, Fuzzy matching: Define the candidate function set: G = {g1, g2, ..., g k Let G be the set of all GIS functions; a pre-trained language model is used to connect the intent I and each GIS function g. i The vectors are converted into embedding vectors, and then the similarity is calculated to obtain the intent I and each GIS function g. i Based on semantic similarity, the GIS function g with the highest similarity is selected.
[0027] Further, step S2 specifically includes:
[0028] Step S25, parameter verification and optimization, includes:
[0029] Step S251: Verify the completeness and correctness of the extracted parameters;
[0030] Step S252: When a missing parameter exists, it is filled in by contextual reasoning or default value.
[0031] Step S253: When there are multiple possible values for the parameters or there are conflicts between the values, the optimal parameter combination is selected through constraint optimization.
[0032] Further, step S2 specifically includes:
[0033] Step S26, instruction generation, including:
[0034] Predefine instruction templates for each GIS function, and populate the parsed parameters into the corresponding instruction template of the target GIS function.
[0035] According to a second aspect, one embodiment provides a GIS software interaction implementation system based on a large language model, the system comprising:
[0036] The requirement text acquisition module is used to acquire the GIS task requirement text input by the user;
[0037] The semantic parsing module is used to preprocess the required text based on a large language model, classify the intent and extract parameters from the preprocessed text, and convert the extracted intent and parameters into operation instructions that can be executed by GIS software.
[0038] The execution feedback module is used to send the obtained operation instructions to the GIS software for execution, obtain the execution results from the GIS software, and provide feedback to the user.
[0039] According to a third aspect, one embodiment provides an electronic device, the device comprising: a processor and a memory;
[0040] The memory is used to store one or more program instructions;
[0041] The processor is configured to run one or more program instructions to execute the steps of a GIS software interactive implementation method based on a large language model as described in any of the preceding claims.
[0042] According to a fourth aspect, one embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a GIS software interaction implementation method based on a large language model as described in any of the preceding claims.
[0043] This application provides a method and system for implementing GIS software interaction based on a large language model, which has the following beneficial effects:
[0044] (1) Lowering the barrier to entry: Users do not need to master GIS terminology and complex operation instructions; they can complete tasks through natural language.
[0045] (2) Improve work efficiency: The system automatically parses user needs and generates GIS-executable operation instructions, saving learning and operation time.
[0046] (3) Strong universality: The system supports mainstream GIS software and is suitable for various scenarios and industry needs.
[0047] (4) Humanized interaction: The system’s ease of use and user experience are improved through natural language interaction. Attached Figure Description
[0048] Figure 1 A flowchart illustrating a GIS software interaction implementation method based on a large language model, provided as an embodiment of this application;
[0049] Figure 2 This is an overall architecture diagram of a GIS software interactive implementation system based on a large language model, provided as an embodiment of this application. Detailed Implementation
[0050] The present application will now be described in further detail with reference to the accompanying drawings and specific embodiments. Similar elements in different embodiments are referred to by related similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of the present application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to the present application are not shown or described in the specification. This is to avoid obscuring the core parts of the present application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.
[0051] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.
[0052] The first embodiment of this application provides a GIS software interaction implementation method based on a large language model, which aims to help users complete GIS-related operations through natural language interaction, without requiring users to have a deep technical background, thus significantly reducing the difficulty of using GIS software. The following is in conjunction with... Figure 1 A detailed explanation will be provided.
[0053] like Figure 1 As shown, in step S1, the GIS task requirement text input by the user is obtained.
[0054] In this embodiment, the user interface can receive natural language input from the user, supporting both text and voice input. The user can describe the task requirements in simple natural language, such as "generate a population distribution heat map of a certain area" or "analyze the land use types of the area".
[0055] Main components of the user interface:
[0056] 1) Input component
[0057] Function: Receives task descriptions from users and supports multiple input methods, including text and voice.
[0058] Features:
[0059] Text input box: Users input their operation requirements via the keyboard, such as "draw a land use map of a certain area".
[0060] Voice input function: Users can describe their operation needs by voice, and the system will convert the voice into text.
[0061] Input prompts: Provide users with optional task templates or prompt statements to help them describe their needs more clearly.
[0062] 2) Output display components
[0063] Function: Presents GIS operation results in an intuitive way, including text, charts, maps, etc.
[0064] Features:
[0065] Text feedback area: Displays the system's parsing results and execution status of user requests, such as "Heatmap generated successfully".
[0066] Graphical display area: Used to present the generated maps, charts, or analysis results.
[0067] Download Results button: Allows users to download the generated charts or maps as files.
[0068] 3) Interactive control components
[0069] Function: Guides users through multiple steps or provides them with options for further actions.
[0070] Features:
[0071] Operation suggestion box: Based on the user's current task, it recommends possible subsequent steps.
[0072] Multi-step task navigation: Supports users to complete more complex tasks, such as generating maps step by step, adjusting layers, etc.
[0073] like Figure 1 As shown, in step S2, based on the large language model, the required text is preprocessed, the preprocessed text is classified into intents and parameters are extracted, and the extracted intents and parameters are converted into operation instructions that can be executed by GIS software.
[0074] In this embodiment, based on the capabilities of large language models (such as GPT), the natural language input by the user is understood and converted, specifically including the following steps:
[0075] Step S21, text preprocessing, includes:
[0076] Step S211: Based on the constructed stop word list, remove stop words from the input text;
[0077] Step S212: Perform character normalization processing on the text.
[0078] Specifically, text preprocessing is used to clean up user input text, removing unnecessary spaces, symbols, etc., to ensure proper input formatting. Text preprocessing mainly includes the following steps:
[0079] (1) Stop word removal: Natural language contains a large number of common words that are not semantically relevant (such as "of", "please", "thank you", etc.), which do not contribute to intent extraction and parameter parsing. The principle of stop word removal is to remove stop words from the input text T through a predefined stop word list S.
[0080] Given text T = {t1, t2, ..., t} n} and the stop word set S = {s1, s2, ..., s} m The preprocessed text is T′.
[0081] Implementation: Construct a stop word list S, which can be based on a publicly available stop word library, such as a Chinese stop word library or a custom word list. After word segmentation, match each word against the stop word list and remove the matching words. Word segmentation and stop word filtering can be implemented using natural language processing libraries (such as NLTK, jieba), and the stop word list can be generated through corpus statistics and manual annotation.
[0082] (2) Character normalization:
[0083] Natural language text may contain redundant symbols, spaces, or other meaningless characters. The task of normalization is to remove this distracting information and ensure consistent text formatting.
[0084] Define a character normalization function f clean (t i Map each word ti to its canonical form ti′:
[0085] T″={t′ i ∣t′ i =f clean (t i ),t i ∈T′}, where T′ is the text after stop words are removed, and T″ is the text after character normalization.
[0086] Implementation method: Character normalization is achieved through regular expression-based symbol cleanup (such as removing punctuation marks) and format conversion. Format conversion includes converting numbers, dates, etc., to a uniform format (e.g., "January 20th" → "2025-01-20").
[0087] Example of character normalization:
[0088] 1) Convert full-width characters to half-width characters: In Chinese input, full-width characters (e.g., full-width punctuation marks and letters) are often used, and in most language processing tasks, they need to be converted to half-width characters (standard ASCII characters). Full-width symbols: "ABCD" → half-width symbols: "ABCD"; full-width punctuation marks: ",。?!" → half-width punctuation marks: ",.?! "
[0089] 2) Simplified Chinese and Traditional Chinese conversion: In Chinese, simplified Chinese characters and traditional Chinese characters differ in visual form but express the same meaning. For example, "马" is a simplified Chinese character, while "馬" is the corresponding traditional Chinese character. A common character normalization operation is to convert traditional Chinese characters to simplified Chinese characters, or unify all characters into a certain form.
[0090] 3) Unify date formats: In text, dates can be expressed in various ways. For example, "January 20, 2025", "2025-01-20" and "1 / 20 / 2025" represent the same date but have different formats. Character normalization unifies these different date formats into a single standard format.
[0091] 4) Number normalization: Sometimes, numbers in text are Chinese numerals (e.g., "二千二百三十") or use different symbols (e.g., "1.2" and "1,2"). The normalization process unifies these into a standard numerical form.
[0092] 5) Unify symbol formats: There may be different expressions of the same symbol in text, for example, both "%" and "%" represent a percent sign. Character normalization unifies these symbols into a single standard symbol.
[0093] 6) There may be extra spaces, line breaks or other meaningless characters in the text. For example, multiple spaces or line breaks may interfere with subsequent processing, and need to be normalized to a single space or removed.
[0094] In this embodiment, the task of semantic parsing is to extract intent I and parameter P from the preprocessed text. Semantic parsing is implemented through intent classification and parameter extraction.
[0095] Step S22, intent classification, includes:
[0096] Step S221, define all GIS tasks as an intent label set Each intent label I i represents a GIS data processing method;
[0097] Step S222, based on a large language model, first convert the preprocessed text into a vector representation of fixed dimension, then input the vector representation into a linear layer or a fully connected layer, and output the probability distribution of each intent label;
[0098] Step S223: Calculate the probability of all possible intent labels using the large language model, and select the intent label with the highest probability, which is the most likely intent I corresponding to the preprocessed text.
[0099] Specifically, intent classification is used to identify GIS tasks in textual language. All GIS tasks are defined as a set of intent labels. Each intent represents a GIS data processing method, such as calculating area, measuring length, or calculating buffers. By training and fine-tuning a large language model, the input text T″ is mapped to the most probable intent label I. I is the intent that maximizes the conditional probability.
[0100]
[0101] Where P(I) i |T″) means that T″ belongs to intention I. i The conditional probability is calculated using a large language model.
[0102] I: The final selected intent label, such as "Generate heatmap".
[0103] The intent set contains all GIS tasks supported by the system (such as "calculate area", "measure length", etc.).
[0104] The method for calculating the maximum intent probability using a large language model is as follows: The large language model converts the input text T″ into a fixed-dimensional vector representation h(T″), which contains the semantic information of the text. Then, the model inputs this vector representation h(T″) into a linear or fully connected layer, the output of which is the probability distribution for each intent label. This process can be accomplished using the softmax function.
[0105]
[0106] h(T″): The semantic vector representation of T″, generated by the large language model.
[0107] W i With Intention I i The corresponding weight vector represents the feature focus of the model for that intent.
[0108] k is a set of intention sizes.
[0109] exp(·): Exponential function used for softmax normalization, ensuring that the sum of all probabilities is 1.
[0110] Finally, the model calculates the probability of all possible intent labels and selects the label with the highest probability.
[0111] Step S23, parameter extraction, includes: rule-based parameter extraction, which includes extracting parameters using predefined rules and templates; large language model-based parameter extraction, which includes automatically extracting parameters using a large language model; and hybrid parameter extraction that combines rule-based extraction and large language model extraction, which combines and complements rule-based extraction and large language model-based extraction.
[0112] Specifically, extract the set of parameters related to the operational requirements based on the input text T″. Each p i It is a key-value pair representing the parameter name and value.
[0113] For example:
[0114] Input text: "Generate a population density heat map for Beijing, dated January 2025."
[0115] The extracted parameter set is: P = {Region: Beijing, Data type: Population density, Time: January 2025}
[0116] There are three parameter extraction methods: basic rule extraction, large language model-based extraction, rule fusion extraction, and hybrid extraction method based on large language model.
[0117] ① Rule-based parameter extraction extracts specific parameter patterns using predefined rules and templates. Rules are typically based on regular expressions (Regex), keyword matching, or template mapping. The mathematical representation of rule extraction is as follows:
[0118] p i =R(T″), i∈{1,2,…,n}
[0119] Where p: the extracted parameter set, consisting of key-value pairs (e.g., {region: Beijing, data type: population density, time: January 2025}).
[0120] R: Parameter extraction rule function, used to match specific patterns (such as regular expressions). Example: Match region r"([\s]+city|[\s]+province|[\s]+district)".
[0121] T″: Preprocessed input text.
[0122] Implementation Steps: 1) Define Parameter Templates: Define keywords or patterns related to parameters according to requirements. Examples: Region: Match administrative divisions (e.g., "Beijing", "Shanghai"). Time: Match date or time format (e.g., "January 2025", "Tomorrow"). Data Type: Match specific terms (e.g., "Population Density", "Temperature"). 2) Regular Expression Extraction: Use regular expressions to match relevant parameters from the text. Examples: Extract Region: r"([^\s]+City|[^\s]+Province|[^\s]+District)"; Extract Time: r"(\d{4}Year\d{1,2}Month|\d{4}-\d{1,2}-\d{1,2})"
[0123] ② Parameter Extraction Based on Large Language Models: Large language models, through contextual understanding, can automatically extract parameters from natural language. Implementation methods include sequence labeling and question answering. Sequence labeling transforms the parameter extraction task into a sequence labeling problem, with each word corresponding to a label (e.g., BERT's NER task). Sequence labeling methods assign a label to each word w... i ∈T″, calculate the label probability distribution P(y i |T″);y i =argmaxP(y i |T″), then the label sequence {y1,y2,…,y m} is mapped to a set of parameters.
[0124] Example:
[0125] Tag categories:
[0126] B-LOC (the first word of a region), I-LOC (the middle word of a region)
[0127] B-TIME (the word beginning with time), I-TIME (the word in the middle of time)
[0128] O (not part of any parameter)
[0129] Input text: "Generate a population density heat map for Beijing, dated January 2025."
[0130] Sequence labeling results: Generate population B-DAT density I-DAT heatmaps for Beijing B-LOC and I-LOC, with time values from year 2025 B-TIME to January I-TIME.
[0131] Question-and-answer method: Extract parameters and transform them into question-and-answer tasks.
[0132] Design a question for each parameter and answer it using a large language model. Examples: Question 1: Where is the region located? → Answer: "Beijing"; Question 2: What is the data type? → Answer: "Population density"; Question 3: What is the time? → Answer: "January 2025"
[0133] ③ The hybrid approach combines rule-based methods with large language models, leveraging the strengths of each. Rules are used to quickly extract obvious parameters, such as standard time or location expressions. Large language models are used for further analysis of unmatched parts. After predicting parameters using the large language model, rules are used for validation or completion.
[0134] Example:
[0135] Input text: "Please generate a population density heat map for Beijing and display the data for 2025."
[0136] Rule extraction:
[0137] Region: Beijing
[0138] Data type: Population density
[0139] Time: 2025
[0140] Model Supplement:
[0141] If a parameter (such as a region) is missing, the model completes it using context.
[0142] Step S24, instruction conversion based on GIS mapping rules, includes:
[0143] Step S241, Rule matching: Based on the predefined mapping rule set F map Its form is: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}, where I i Indicates intention, g i This corresponds to the GIS function; when the intent I parsed from the preprocessed text exists in F map In the middle, the corresponding GIS function is found through direct matching: g = F map (I);
[0144] Step S242, Fuzzy matching: Define the candidate function set: G = {g1, g2, ..., g k Let G be the set of all GIS functions; a pre-trained language model is used to connect the intent I and each GIS function g. i The vectors are converted into embedding vectors, and then the similarity is calculated to obtain the intent I and each GIS function g. iBased on semantic similarity, the GIS function g with the highest similarity is selected.
[0145] The core of GIS mapping rules lies in transforming the parsed intent I and parameters P into operational instructions for the GIS system. This is achieved through rule matching and fuzzy matching.
[0146] (1) Rule matching is based on a predefined set of mapping rules F map Its form is: F map ={(I1,g1),(I2,g2),…,(I n ,g n )}. Among them, I i g represents a parsed intent. i This corresponds to a GIS function (such as "generate heatmap") mapped to a HeatMap in the GIS tool. When the parsed intent I exists in Fmap, the corresponding function is found through direct matching: g = F map (I)
[0147] For example: Input intent I = "Generate heatmap"
[0148] Matching result: g = HeatMap(P)
[0149] (2) Fuzzy matching: When intent I fails to match F map When an exact match is found, fuzzy matching is used to find the most similar GIS function g based on semantic similarity. The steps are as follows:
[0150] 1. Define the candidate feature set: G = {g1, g2, ..., g...} k}, G is the collection of all GIS functions.
[0151] 2. Semantic Representation: Using pre-trained language models (such as BERT, Sentence-BERT) to represent the input intent I and the functional description g i Convert to embedding vector:
[0152] v I =Embedding(I),
[0153] I: User input intent, usually a command described in natural language, such as "generate a heat map of Beijing".
[0154] g i : Description of the candidate function, such as "generate a heat map based on the input point density data".
[0155] Embedding(·): An operation that converts natural language text into a high-dimensional vector using a pre-trained language model (such as BERT or Sentence-BERT). This vector represents the semantic information of the text.
[0156] v I : The semantic embedding vector of user input intent I.
[0157] Candidate function g i The semantic embedding vector.
[0158] 3. Similarity Calculation: Utilize cosine similarity to calculate the similarity between intent I and each function g. i Semantic similarity:
[0159]
[0160] Sim(I,g i User input intent I and candidate functions g i The semantic similarity is in the range of [-1,1][-1,1][-1,1], and the larger the value, the more similar the semantics.
[0161] ||v I ||and The norm (modulus) of a vector represents the length of the vector.
[0162] 4. Select the optimal function: Select the function g with the highest similarity.
[0163]
[0164] g * The GIS function that most closely resembles the user's input intent (i.e., the function ultimately selected).
[0165] argmax: represents the search for the value that makes the similarity Sim(I,g) equal to 1. i Maximize the functionality g i .
[0166] G: Set of candidate features.
[0167] Sim(I,g i User input intent and function g i Semantic similarity.
[0168] Example explanation:
[0169] Suppose the user's input intent is "create a heat map", but the mapping rule set F mapThe code does not include precise rules for "creating a heatmap". Through fuzzy matching, "creating a heatmap" is transformed into an embedding vector vI. The embeddings of the candidate features G, such as HeatMap and ContourMap, are compared. Similarity is calculated, assuming the result is:
[0170] Sim("Create Heatmap", HeatMap) = 0.92
[0171] Sim("Create a heatmap", ContourMap) = 0.65
[0172] The final choice is g = HeatMap.
[0173] Step S25, parameter verification and optimization, includes:
[0174] Step S251: Verify the completeness and correctness of the extracted parameters;
[0175] Step S252: When a missing parameter exists, it is filled in by contextual reasoning or default value.
[0176] Step S253: When there are multiple possible values for the parameters or there are conflicts between the values, the optimal parameter combination is selected through constraint optimization.
[0177] In this embodiment, the core of parameter verification and optimization lies in ensuring the completeness and correctness of the parsed parameter P in meeting the functional requirements. This relies on constraint optimization and contextual reasoning, combined with actual parameter verification, missing parameter completion, and default value settings to guarantee the validity of the parameters and the smooth execution of the function.
[0178] 1. The purpose of integrity verification is to determine whether parameter P contains all the necessary information to meet the functional requirements.
[0179] Let the parameter set be P = {p1, p2, ..., p...} n The required parameter set is P. req ={q1,q2,…,q m The integrity of parameters is checked using the following constraints:
[0180] If q i ∈P req and Then there are missing parameters. If q i ∈P req And q i If ∈P, then there are no missing parameters.
[0181] Example:
[0182] Required parameter set: Preq = {region, data type, time}
[0183] Actual parameter: P = {Region: Beijing, Data type: Population density}
[0184] Missing part: Time
[0185] 2. Parameter completion
[0186] When missing parameters exist, they need to be filled in using contextual reasoning or default values.
[0187] (1) Context completion (based on Bayesian inference)
[0188] Contextual completion utilizes historical data, contextual information from user input, or common patterns, and selects the most likely completion value through Bayesian inference.
[0189] Let the missing parameter be p. k Its possible value set is V = {v1, v2, ..., v} n The goal of Bayesian inference is to calculate the posterior probability of each possible value and select the value with the highest probability.
[0190]
[0191] Among them: C context information (such as other parameters, history, user preferences).
[0192] P(v i |C): Infer the parameter value v based on the context C. i The posterior probability.
[0193] Expanding using Bayes' theorem:
[0194]
[0195] P(C∣v i ): Given parameter value v i Contextual conditional probability.
[0196] P(vi): The prior probability of the parameter value (which can be set based on historical statistics or domain knowledge).
[0197] P(C): Normalization constant.
[0198] Example:
[0199] User input: "Generate a population density heat map of Beijing".
[0200] Missing parameter: time p_{\text{time}}ptime.
[0201] C: The context is "Generate a population density heat map of Beijing".
[0202] V = {2024, January 2025, default: most recent time period}
[0203] V = {2024, January 2025, default: most recent time period}.
[0204] Through Bayesian inference, the system may determine that "the most recent time period" is a high-probability completion value.
[0205] (2) Default value completion
[0206] When the context information is insufficient, domain knowledge or system default values can be used to fill in the missing parameters.
[0207] Example:
[0208] If the time parameter is missing, the default value is set to "current time".
[0209] When the region parameter is missing, the default value is set to "Nationwide".
[0210] 3. Parameter optimization
[0211] When parameter P has multiple possible values or there are conflicts between the values, the optimal combination of parameters is selected through constraint optimization.
[0212] Optimization goal:
[0213] Define an objective function f(P), evaluate the merits of parameter combinations, and optimize it under constraints:
[0214]
[0215] Where: P * This is the optimized result.
[0216] f(P) is the objective function (such as parameter rationality score, user satisfaction, etc.).
[0217] g i (P): Inequality constraints (such as restrictions on the range of parameter values).
[0218] h j (P): Equality constraints (such as parameter logic consistency).
[0219] Example:
[0220] The user inputs "Generate a heat map of Beijing".
[0221] Parameter P = {Region: Beijing, Data type: Undetermined, Time: Current time}
[0222] Optional data types: {Population density, Traffic flow, Temperature}
[0223] Constraint optimization:
[0224] f(P): The reasonableness score for different data types.
[0225] g(P): Ensures that the data type matches the locale time.
[0226] Optimization result: P* = {Region: Beijing, Data type: Population density, Time: Current time}.
[0227] Step S26, instruction generation, includes: predefining instruction templates for each GIS function, and filling the parsed parameters into the corresponding instruction template of the target GIS function.
[0228] In this embodiment, executable instructions for GIS software are automatically generated based on the parsed intent I and parameter P.
[0229] Implementation method:
[0230] 1. Template generation: Define instruction templates for common GIS functions.
[0231] Example: Python code template for the HeatMap function:
[0232] generate_heatmap(area="{region}", data_type="{data type}", time="{time}")
[0233] 2. Dynamic interpolation: Parse parameter P and fill it into the template.
[0234] Example: Input parameter P = {Region: Beijing, Data type: Population density, Time: January 2025}
[0235] generate_heatmap(area="Beijing", data_type="Population Density", time="January 2025")
[0236] 3. Multi-software support: Supports mainstream GIS platforms such as ArcGIS, QGIS, SuperMap, and Esprit. Automatically generates platform-specific script formats (such as Python, R, and toolbox commands).
[0237] Furthermore, this embodiment also includes a GIS interface module. This module is responsible for interacting with GIS software (such as ArcGIS, QGIS, etc.), sending instructions to the GIS software, receiving its execution results, and executing operations by calling APIs or script interfaces. This ensures the integrity and compatibility of the operations, supports multiple GIS software environments, and can dynamically adapt to different interface calling methods. Implementation details are as follows:
[0238] 1) API Call: Utilize the development interface provided by the GIS software to run the generated instructions, providing standardized interface functions for the instruction generation module to call.
[0239] 2) Interface adaptation: Provides an interface adapter mode to support a variety of GIS tools.
[0240] 3) Command Execution: The module sends the generated commands to the target software via the GIS adapter. It receives and parses the execution results, and returns them to the system in a standardized format.
[0241] 4) Error Handling: Capture exceptions during API calls (such as network connection failures, incorrect parameters, etc.). Provide detailed error information to help users understand and adjust their input requirements.
[0242] like Figure 1 As shown, in step S3, the obtained operation instructions are sent to the GIS software for execution, and the execution results of the GIS software are obtained and fed back to the user.
[0243] In this embodiment, the execution feedback module obtains the execution results of the GIS software and provides feedback to the user in natural language. The feedback content may include prompts indicating whether the operation was successful, displays of generated charts or maps, or further operational suggestions. Implementation details are as follows:
[0244] 1) Result Analysis:
[0245] Receive the results returned by the GIS interface module, determine the execution status (success / failure), and generate feedback content according to the specific situation.
[0246] Example of feedback content:
[0247] Success: "Heatmap generated successfully. File saved at: C: / GIS_Project / heatmap.tif"
[0248] Failure: "Heatmap generation failed because the input data format is incorrect."
[0249] 2) Natural Language Generation (NLG):
[0250] Generate user-friendly feedback based on templates or language models.
[0251] 3) Multiple forms of feedback:
[0252] Text feedback: Explains the operation results in natural language.
[0253] Charts or maps: Directly embed the results generated by GIS operations (such as map snapshots).
[0254] 4) Log recording:
[0255] The execution feedback is recorded in the system log to facilitate subsequent problem tracking and analysis.
[0256] Corresponding to the aforementioned method for implementing GIS software interaction based on a large language model, this application also discloses a system for implementing GIS software interaction based on a large language model, such as... Figure 2 As shown, it specifically includes:
[0257] The requirement text acquisition module is used to acquire the GIS task requirement text input by the user;
[0258] The semantic parsing module is used to preprocess the required text based on a large language model, classify the intent and extract parameters from the preprocessed text, and convert the extracted intent and parameters into operation instructions that can be executed by GIS software.
[0259] The execution feedback module is used to send the obtained operation instructions to the GIS software for execution, obtain the execution results from the GIS software, and provide feedback to the user.
[0260] It should be noted that for a detailed description of the GIS software interaction implementation system based on a large language model provided in the embodiments of this application, please refer to the relevant description of the GIS software interaction implementation method based on a large language model provided in the embodiments of this application, which will not be repeated here.
[0261] In addition, embodiments of this application also provide an electronic device, the device comprising: a processor and a memory; the memory being used to store one or more program instructions; the processor being used to execute one or more program instructions to perform the steps of a GIS software interaction implementation method based on a large language model as described in any of the preceding claims.
[0262] It should be noted that for a detailed description of an electronic device provided in the embodiments of this application, please refer to the relevant description of a GIS software interaction implementation method based on a large language model provided in the embodiments of this application, which will not be repeated here.
[0263] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the GIS software interaction implementation method based on a large language model as described in any of the preceding claims.
[0264] It should be noted that for a detailed description of the computer-readable storage medium provided in the embodiments of this application, please refer to the relevant description of the interactive implementation method of GIS software based on a large language model provided in the embodiments of this application, which will not be repeated here.
[0265] Those skilled in the art will understand that all or part of the functions of the various methods in the above embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a server, another computer, disk, optical disk, flash drive, or external hard drive, etc., and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.
[0266] The above examples illustrate this application only to aid understanding and are not intended to limit its scope. Those skilled in the art to which this application pertains can make various simple deductions, modifications, or substitutions based on the ideas presented.
Claims
1. A GIS software interaction implementation method based on a large language model, characterized in that, The method includes: Step S1: Obtain the GIS task requirement text input by the user; Step S2: Based on the large language model, the required text is preprocessed, the preprocessed text is classified into intents and parameters are extracted, and the extracted intents and parameters are converted into operation instructions that can be executed by GIS software. Step S3: Send the obtained operation instructions to the GIS software for execution, obtain the execution results from the GIS software, and provide feedback to the user. in: Step S2 specifically includes: Step S22, Intent Classification, includes: Step S221, define all GIS tasks as a set of intent tags Each intent tag represents a GIS data processing mode; Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label. Step S223: Calculate the probability of all intent labels using the large language model, and select the intent label with the highest probability, which is the most likely intent I corresponding to the preprocessed text. Step S23, parameter extraction, includes: Rule-based parameter extraction includes parameter extraction using predefined rules and templates; Parameter extraction based on large language models, including automatic parameter extraction using large language models; Hybrid parameter extraction, which integrates rule extraction and large language model extraction, combines and complements these two approaches. Step S24, instruction conversion based on GIS mapping rules, includes: Step S241, Rule matching: Based on a predefined set of mapping rules Its form is: ,in Intent, This corresponds to the GIS function; when the intent I parsed from the preprocessed text exists... In the middle, the corresponding GIS function can be found through direct matching: ; Step S242, Fuzzy Matching: Define the candidate function set: G is the set of all GIS functions; a pre-trained language model is used to connect the intent I with each GIS function. The vectors are converted into embedding vectors, and then the intent I is calculated to match each GIS function using similarity calculations. Based on semantic similarity, the GIS function g with the highest similarity is selected.
2. The GIS software interaction implementation method based on a large language model as described in claim 1, characterized in that, Step S2 specifically includes: Step S21, text preprocessing, includes: Step S211: Based on the constructed stop word list, remove stop words from the input text; Step S212: Perform character normalization processing on the text.
3. The GIS software interaction implementation method based on a large language model as described in claim 2, characterized in that, Step S2 specifically includes: Step S25, parameter verification and optimization, includes: Step S251: Verify the completeness and correctness of the extracted parameters; Step S252: When a missing parameter exists, it is filled in by contextual reasoning or default value. Step S253: When there are multiple possible values for the parameters or there are conflicts between the values, the optimal parameter combination is selected through constraint optimization.
4. The GIS software interaction implementation method based on a large language model as described in claim 3, characterized in that, Step S2 specifically includes: Step S26, instruction generation, including: Predefine instruction templates for each GIS function, and populate the parsed parameters into the corresponding instruction template of the target GIS function.
5. A GIS software interactive implementation system based on a large language model, characterized in that, The system includes: The requirement text acquisition module is used to acquire the GIS task requirement text input by the user. The semantic parsing module is used to preprocess the required text based on a large language model, classify the intent and extract parameters from the preprocessed text, and convert the extracted intent and parameters into operation instructions that can be executed by GIS software. The execution feedback module is used to send the received operation instructions to the GIS software for execution, obtain the execution results from the GIS software, and provide feedback to the user. in: The method based on a large language model involves preprocessing the required text, classifying intents and extracting parameters from the preprocessed text, and converting the extracted intents and parameters into executable commands for GIS software. Specifically, this includes: Step S22, Intent Classification, includes: Step S221: Define all GIS tasks as intent label sets. Each intent tag This represents a GIS data processing method; Step S222: Based on the large language model, the preprocessed text is first converted into a fixed-dimensional vector representation, and then the vector representation is input into a linear layer or a fully connected layer to output the probability distribution of each intent label. Step S223: Calculate the probability of all intent labels using the large language model, and select the intent label with the highest probability, which is the most likely intent I corresponding to the preprocessed text. Step S23, parameter extraction, includes: Rule-based parameter extraction includes parameter extraction using predefined rules and templates; Parameter extraction based on large language models, including automatic parameter extraction using large language models; Hybrid parameter extraction, which integrates rule extraction and large language model extraction, combines and complements these two approaches. Step S24, instruction conversion based on GIS mapping rules, includes: Step S241, Rule matching: Based on a predefined set of mapping rules Its form is: ,in Intent, This corresponds to the GIS function; when the intent I parsed from the preprocessed text exists... In the middle, the corresponding GIS function can be found through direct matching: ; Step S242, Fuzzy Matching: Define the candidate function set: G is the set of all GIS functions; a pre-trained language model is used to connect the intent I with each GIS function. The vectors are converted into embedding vectors, and then the intent I is calculated to match each GIS function using similarity calculations. Based on semantic similarity, the GIS function g with the highest similarity is selected.
6. An electronic device, characterized in that, The device includes: a processor and a memory; The memory is used to store one or more program instructions; The processor is configured to run one or more program instructions to perform the steps of a GIS software interactive implementation method based on a large language model as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of a GIS software interaction implementation method based on a large language model as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Mutual generation type artificial intelligence system based on multi-dimensional spatio-temporal information vector graph
CN118484551A
Function calling method based on natural language
CN118642787A