Method, device, equipment and medium for generating geographic spatial information samples

By extracting structured triplets from map service data and analyzing text sets, and combining large language models to generate natural language text, the problems of low efficiency and insufficient accuracy of geospatial information sample generation in the prior art are solved, and efficient and diverse sample generation is achieved.

CN119938806BActive Publication Date: 2025-09-02CENT SOUTH UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510421483.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-09-02
Estimated Expiration
2045-04-07

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently generate high-quality geospatial information training samples, manual labeling is costly and inefficient, and the method based on rule templates is poor in flexibility. Data enhancement may destroy semantic integrity, resulting in insufficient accuracy of the model when identifying geographic information.

Method used

By obtaining map service data, determining the geographical elements within the research area, calculating spatial relationships to form a structured triple, analyzing the geospatial information text set and clustering, using a large language model to generate natural language text based on the propt template expansion, and generating geospatial information samples.

Benefits of technology

It improves the diversity of geospatial information data generation, avoids the high cost and inefficiency of manual annotation, overcomes the lack of flexibility of rule templates and the semantic bias of data enhancement, and improves the accuracy of the model when identifying geographic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938806B_ABST
    Figure CN119938806B_ABST
Patent Text Reader

Abstract

The present invention provides a method, apparatus, device and medium for generating geospatial information samples, which utilize spatial relationship calculation to extract structured geospatial triples from map service data, thus avoiding the high cost and inefficiency of manual annotation; the obtained geospatial information text set corresponding to the study area is analyzed to obtain a spatial relationship text description form, and the geospatial information structured triples and the encoded spatial relationship text description are input into a large language model for expansion based on a prompt template, thus avoiding the semantic bias that may be caused by data enhancement, overcoming the limitations of rule templates in processing diverse corpora, and improving the diversity of geospatial information data generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of spatiotemporal knowledge extraction, and in particular to a method, device, equipment and medium for generating a geographic space information sample. Background Art

[0002] Geospatial information describes the location, characteristics, distribution, and interrelationships of geographic entities in space. It deeply reflects the complex attributes, dynamic changes, and inherent connections of geographic elements, providing crucial knowledge support for areas such as regional planning, resource management, and disaster warning. It is also an important knowledge component in the construction of spatiotemporal knowledge graphs. Geospatial information comes from a wide range of sources, including basic surveying and mapping, sensors, news reports, scientific literature, and social media text data. This text data contains rich geographic information and is easy to access, covers a wide range of areas, and is frequently updated. It is of great value in improving the currency and updating of knowledge graphs.

[0003] With the advent of the digital age, the generation of text data is increasing exponentially. Therefore, the rapid and accurate extraction and parsing of geospatial information from text data will help promote the in-depth utilization of geospatial data and intelligent geographic semantic understanding. Information extraction is a key technology in natural language processing, aiming to extract structured information from unstructured text. It primarily includes techniques such as named entity recognition and relationship extraction. Related model methods have evolved from rule-based template matching, statistical learning, deep learning, to pre-trained models. In particular, model algorithms represented by deep learning and pre-trained language models rely on large-scale, high-quality sample data for model training. However, the scarcity of annotated text data in the field of geospatial information makes it difficult for traditional general models that rely on large amounts of annotated data to fully capture and recognize the geographic information contained in text. Furthermore, the relatively sparse label density of geographic information often makes it difficult for models to distinguish boundaries between different geographic information, and thus cannot accurately locate entities and describe relationships. Therefore, obtaining high-quality geospatial information training samples is crucial.

[0004] Existing methods for acquiring annotated corpora mainly include manual annotation, rule-based template generation, and data augmentation. Among them, manual annotation ensures high accuracy and meets the requirements of specific domain tasks by carefully processing and annotating corpora. For example, some projects have built large-scale syntactic treebanks through expert annotation, while others combine semantic role annotation with core reference annotation to provide rich corpus support. However, manual annotation relies on manual and detailed processing of each data set, which is inefficient and costly. At the same time, due to subjective bias, it is difficult to unify the quality and consistency of the annotated data. Rule-based template methods provide data generation through cosine-set clear logical rules or semantic templates. For example, structured data can be converted into natural language text by designing rules and templates. Large amounts of virtual data are generated based on predefined rules and templates and are widely used in testing and data generation scenarios. However, as the corpus structure or task requirements change, these methods often cannot adapt to existing rules, resulting in inaccurate or incomplete extracted information. The fixed nature of the rules makes them lack flexibility and scalability. For each new task or dataset, the rule templates need to be frequently adjusted. Data augmentation effectively expands the data size and increases its diversity by transforming existing corpora (e.g., data replacement, synonym substitution, sentence structure transformation, etc.). For example, data replacement can generate large amounts of data and improve the robustness of text classification models. Back-translation is widely used in machine translation to generate diverse parallel corpora. However, this process can damage the semantic integrity of the original corpus, making it difficult to fully guarantee the quality of the generated samples. Furthermore, data augmentation is typically based on existing data and cannot generate truly new information. Summary of the Invention

[0005] The present invention provides a method, apparatus, device and medium for generating geospatial information samples, the purpose of which is to enhance the diversity of geospatial information data generation.

[0006] In order to achieve the above object, the present invention provides a method for generating a geospatial information sample, comprising:

[0007] Step 1: Obtain map service data of the study area and determine the geographic elements within the study area based on the map service data;

[0008] Step 2: Calculate the spatial relationship between geographic elements based on map service data to obtain structured triples of geographic spatial information;

[0009] Step 3: Analyze the obtained geospatial information text set corresponding to the study area to form a text description structure, and cluster the text description structure to obtain multiple clustering results;

[0010] Step 4: combining the structural features of the geospatial information text set to identify common features of the text description structure in multiple clustering results, and analyzing each clustering result based on the common features to obtain a spatial relationship text description form;

[0011] Step 5: Encode the spatial relationship text description form, and input the geospatial information structured triples and the encoded spatial relationship text description into the large language model. The large language model expands the geospatial information structured triples based on the prompt template and the encoded spatial relationship text description to generate natural language text.

[0012] Step 6: Merge the natural language text with the structured triples of geospatial information to obtain geospatial information samples.

[0013] Furthermore, before determining the geographic features within the study area based on map service data, the following is also included:

[0014] The map service data is formatted and parsed, and abnormal data is removed to obtain preprocessed map service data. Abnormal data includes standard data caused by human errors and missing data.

[0015] Furthermore, the spatial relationships between geographic features are calculated based on map service data to obtain structured triplets of geospatial information, including:

[0016] Build a spatial index for all geographic features in the study area through R-tree;

[0017] Randomly select a geographical element from all the geographical elements in the study area as the target geographical element, and obtain the neighbor elements whose distance to the target geographical element is less than the preset threshold through spatial index to form the nearest neighbor candidate set;

[0018] Randomly select several neighbor elements from the nearest neighbor candidate set, and calculate the spatial relationship between each neighbor element and the target geographic element, and obtain the calculation results in the form of triples;

[0019] Repeatedly select the target geographic feature and calculate the spatial relationship between the target geographic feature selected each time and each neighbor feature to obtain the calculation result in the form of triples;

[0020] All calculation results in triple form that meet the preservation conditions are saved to obtain structured triples of geospatial information.

[0021] Furthermore, before saving all triplet calculation results that meet the saving conditions, including:

[0022] Count the spatial relationship categories in the calculation results of all triple forms;

[0023] Set the saving conditions based on the spatial relationship category.

[0024] Furthermore, the obtained geospatial information text set corresponding to the study area is analyzed to form a text description structure, including:

[0025] According to the data characteristics of the geospatial information field, a geospatial information text set corresponding to the research area is obtained from the public information website;

[0026] The geospatial information text set is tagged with part-of-speech using the Qwen-max model to identify geographic entities, action descriptions, and modification information in the geospatial information text set.

[0027] The grammatical structure of the sentences in the geospatial information text set after part-of-speech tagging is parsed through the dependency tree to form a text description structure.

[0028] Furthermore, the text description structure is clustered to obtain multiple clustering results, including:

[0029] Use the Sentence-BERT model to vectorize the text description structure to obtain a high-dimensional text description structure;

[0030] The DBSCAN model is used to perform density clustering on high-dimensional text description structures to obtain multiple clustering results, each of which contains a group of similar high-dimensional text description structures.

[0031] Furthermore, the large language model expands the structured triples of geospatial information based on the prompt template and the encoded spatial relationship text description to generate the natural language text expression:

[0032]

[0033] in, represents natural language text, Represents a large language model, Represents a structured triple of geospatial information, 、 They all represent geographical elements. Representing geographic features and geographical elements The spatial relationship between Represents the encoded text description of the spatial relationship.

[0034] The present invention also provides a device for generating a geographic space information sample, comprising:

[0035] An acquisition module is used to obtain map service data of the study area and determine the geographic elements within the study area based on the map service data;

[0036] The calculation module is used to calculate the spatial relationship between geographic elements based on map service data to obtain structured triples of geographic spatial information;

[0037] The first analysis module is used to analyze the obtained geographic spatial information text set corresponding to the study area to form a text description structure, and cluster the text description structure to obtain multiple clustering results;

[0038] The second analysis module is used to identify common features of the text description structure in multiple clustering results based on the structural features of the geospatial information text set, and analyze each clustering result based on the common features to obtain a text description form of the spatial relationship;

[0039] The expansion module is used to encode the spatial relationship text description form and input the geospatial information structured triples and the encoded spatial relationship text description into the large language model. The large language model expands the geospatial information structured triples based on the prompt template and the encoded spatial relationship text description to generate natural language text;

[0040] The merging module is used to merge the natural language text with the structured triples of geospatial information to obtain geospatial information samples.

[0041] The present invention also provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for generating geographic space information samples when executing the computer program.

[0042] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method for generating a geographic spatial information sample is implemented.

[0043] The above solution of the present invention has the following beneficial effects:

[0044] The present invention determines the geographical elements in the study area based on the map service data of the study area, calculates the spatial relationship between the geographical elements, and obtains the structured triples of geographical spatial information; analyzes the obtained geographical spatial information text set corresponding to the study area, forms a text description structure and clusters it to obtain multiple clustering results; identifies the common features of the text description structure in the multiple clustering results, analyzes each clustering result, and obtains the spatial relationship text description form; encodes the spatial relationship text description form, and inputs the geographical spatial information structured triples and the encoded spatial relationship text description into a large language model for expansion based on a prompt template to generate natural language text; The language text is merged with the structured triples of geographic spatial information to obtain a geographic spatial information sample; compared with the existing technology, the present invention uses spatial relationship calculation to extract structured geospatial triples from map service data, avoiding the high cost and inefficiency of manual annotation; the obtained geospatial information text set corresponding to the study area is analyzed to obtain a spatial relationship text description form, and the geospatial information structured triples and the encoded spatial relationship text description are input into a large language model for expansion based on the prompt template, avoiding the semantic bias that may be caused by data enhancement, overcoming the limitations of rule templates in processing diverse corpora, and improving the diversity of geospatial information data generation.

[0045] Other beneficial effects of the present invention will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 Schematic diagram of a flow chart of an embodiment of the present invention;

[0047] Figure 2 This is a schematic diagram of the structure of a device for generating geographic spatial information samples according to an embodiment of the present invention;

[0048] Figure 3 Schematic diagram of the structure of the terminal device in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] To make the technical problems, technical solutions, and advantages to be solved by the present invention more clear, the following is a detailed description with reference to the accompanying drawings and specific embodiments. It is obvious that the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0050] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate and simplify the description of the present invention. They are not intended to indicate or imply that the devices or components referred to must have, be constructed, or operate in a specific orientation, and therefore should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0051] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0052] In response to existing problems, the present invention provides a method, device, equipment and medium for generating a geographic space information sample.

[0053] like Figure 1 As shown, an embodiment of the present invention provides a method for generating a geospatial information sample, comprising:

[0054] Step 1: Obtain map service data of the study area and determine the geographic elements within the study area based on the map service data;

[0055] Step 2: Calculate the spatial relationship between geographic elements based on map service data to obtain structured triples of geographic spatial information;

[0056] Step 3: Analyze the obtained geospatial information text set corresponding to the study area to form a text description structure, and cluster the text description structure to obtain multiple clustering results;

[0057] Step 4: combining the structural features of the geospatial information text set to identify common features of the text description structure in multiple clustering results, and analyzing each clustering result based on the common features to obtain a spatial relationship text description form;

[0058] Step 5: Encode the spatial relationship text description form, and input the geospatial information structured triples and the encoded spatial relationship text description into the large language model. The large language model expands the geospatial information structured triples based on the prompt template and the encoded spatial relationship text description to generate natural language text.

[0059] Step 6: Merge the natural language text with the structured triples of geospatial information to obtain geospatial information samples.

[0060] The embodiment of the present invention uses a first-tier city in mainland China as a research area, and the map service data includes point of interest (POI) data, road data, and building data in a public map (OSM, Open Street Map).

[0061] Most preferably, before determining the geographic features within the study area based on map service data, the method further includes:

[0062] The map service data is formatted and parsed, and abnormal data is removed to obtain preprocessed map service data. Abnormal data includes standard data caused by human errors and missing data.

[0063] Specifically, the spatial relationships between geographic elements are calculated based on map service data to obtain structured triplets of geographic spatial information, including:

[0064] All geographic features in the study area are analyzed through R-tree Building a spatial index , the expression is:

[0065]

[0066] All geographic features within the study area Randomly select a geographic feature as the target geographic feature , through spatial index Get the target geographic feature The neighbor elements whose distance is less than the preset threshold form the nearest neighbor candidate set , the expression is:

[0067]

[0068] in, represents the number of neighbor elements, represents the k-nearest neighbor algorithm, , Indicates the neighbor features whose distance is less than the preset threshold;

[0069] From the nearest neighbor candidate set Randomly select Neighbor features , and calculate the relationship between each neighbor feature and the target geographic feature respectively The spatial relationship between them is used to obtain the calculation result in the form of triples. The calculation expression is:

[0070]

[0071] in, Indicates the Neighbor features whose distance is less than the preset threshold, Indicates the target geographic element and the The spatial relationship between neighbor features whose distance is less than the preset threshold. ;

[0072] Repeatedly select target geographic features , and calculate the target geographic elements selected each time The spatial relationship between each neighboring feature includes: adjacency (e.g., location A + action + location B), orientation (e.g., location A + locator + location B), intersection (e.g., location A + and + location B + intersects / intersects / intersects), metric (e.g., location A + distance + location B + additional information), inclusion (e.g., location A + is located + location B + within), and separation (e.g., location A + action + quantity + distance unit + location B). The calculation results are obtained in the form of triples.

[0073] All calculation results in triple form that meet the preservation conditions are saved to obtain structured triples of geospatial information.

[0074] Most preferably, before saving all the calculation results in triple form that meet the saving conditions, the method further includes:

[0075] Count all spatial relationship categories in the calculation results of triple forms ;

[0076] In order to ensure a balance in the number of different spatial relationship categories, each time the calculation results in triple form are saved, the saving conditions need to be set according to the spatial relationship category.

[0077] Specifically, the obtained geospatial information text set corresponding to the study area is analyzed to form a text description structure, including:

[0078] Because text data in the field of geospatial information has complex characteristics of multiple scales, multiple granularities, and multiple dimensions, it faces the problems of scarce annotated data and sparse label density. Based on the data characteristics of the geospatial information field, the embodiments of the present invention use web crawler tools to efficiently obtain geospatial information text sets corresponding to the research area from public information websites. The public information websites are various travel websites, and the geospatial information text sets can be travel guides shared by multiple travelers.

[0079] The Qwen-max model is used to perform part-of-speech tagging on the geospatial information text set, and the geographic entities (such as place names), action descriptions (such as verbs), and modifying information (such as time, distance, etc.) in the geospatial information text set are identified, which can be expressed as: and ,in, Represents a sequence of words, Indicates the corresponding part-of-speech tag;

[0080] Through the dependency tree The grammatical structure of the sentences in the geospatial information text set after part-of-speech tagging is parsed to form a text description structure, where: Represents a word node, It represents dependency relationship edge, and the grammatical structure includes subject-predicate relationship and object relationship.

[0081] Specifically, we use web crawler tools to efficiently obtain geospatial information text sets corresponding to the study area on public information websites, including:

[0082] Efficiently obtain text information related to the research area through web crawler tools on public information websites;

[0083] Regular expressions are used to remove special characters and escape characters from text information related to the study area to ensure the standardization of the extracted text;

[0084] Using sentence segmentation methods, long paragraphs of text information related to the research area are broken down into independent sentences, obtaining a set of candidate sentences that are convenient for subsequent processing;

[0085] Combining the powerful data processing and reasoning capabilities of the large language model, supplemented by the experience of domain experts to establish screening rules, the candidate sentence set is screened multiple times. The large language model used in this embodiment of the present invention is the Qwen-max model. Suppose the sentence set after each round of screening is , the screening logic can be described as:

[0086]

[0087] in, Represents the sentence set after the next round of screening, Represents a filtering operation, Indicates the filtering rules;

[0088] After multiple rounds of screening, a high-quality geospatial information text set rich in geospatial descriptions was finally constructed.

[0089] The embodiment of the present invention takes "A city museum is located at the confluence of a certain river and a certain river" as an example, performs part-of-speech tagging and dependency syntax analysis, identifies the core components in the sentence and their syntactic relationships, and then combines the idea of ​​frame semantics to annotate each component in the sentence with a label that conforms to the semantic role. For example, the geographical entity is annotated as Location, located is annotated as V, and the intersection is annotated as Junction. The text description structure is .

[0090] Specifically, the text description structure is clustered to obtain multiple clustering results, including:

[0091] Use the Sentence-BERT model to vectorize the text description structure to obtain a high-dimensional text description structure;

[0092] The DBSCAN model is used to perform density clustering on high-dimensional text description structures to obtain multiple clustering results, each of which contains a group of similar high-dimensional text description structures.

[0093] It should be noted that the Sentence-BERT model is a sentence-level embedding model that can efficiently generate semantically rich sentence vectors and support fast text similarity calculation and cluster analysis; the DBSCAN model can effectively process high-dimensional text vector data, automatically identify noise points, and automatically determine the number of clusters based on density; after combining the Sentence-BERT model for text vectorization, neighborhood density clustering is performed through the DBSCAN model, which can effectively identify text description forms with similar structures.

[0094] Therefore, the text description structure First, the Sentence-BERT model is applied for vectorization to convert each text description into a high-dimensional vector representation to obtain a high-dimensional text description structure; then, the DBSCAN model is used for density clustering to divide the high-dimensional text description structure into several clusters. , each cluster Contains a group of similar text description structures, and each cluster corresponds to each clustering result one by one; the DBSCAN model determines the core points of the cluster through the following conditions:

[0095]

[0096] in, Represents the text description structure With the radius The neighborhood within the range of Indicates the density threshold. When a text describes a structure When this condition is met, it is considered as a core point and expanded into a cluster. This time, the radius of the area is set. is 0.3, the minimum number of neighbor points is 10.

[0097] Finally, through in-depth analysis of all clustering results and combining the structural characteristics of the geospatial information text set, the common characteristics of the text description structure contained in different clustering results can be identified; through in-depth analysis of the center point or representative text of each cluster center, the corresponding spatial relationship text description form can be extracted. , such as adjacent relations (such as location A + action + location B), directional relations (such as location A + directional word + location B), intersection relations (such as location A + and + location B + intersect / intersect / intersect), measurement relations (such as location A + distance + location B + additional information), inclusion relations (such as location A + located in + location B + within), and separation relations (such as location A + action + quantity + distance unit + location B).

[0098] It should be noted that, in order to further generate semantically rich natural language text, the embodiment of the present invention adopts a hybrid method combining Chain-of-Thought and Zero-Shot prompting to construct a series of highly general prompt templates. According to the logical deduction steps of the prompt templates, the large language model is guided to gradually expand the semantics of the triples, while ensuring that the generated sentences are natural, fluent and rich in information.

[0099] Specifically, the large language model expands the structured triples of geospatial information based on the prompt template and the encoded spatial relationship text description to generate the natural language text expression:

[0100]

[0101] in, represents natural language text, Represents a large language model, Represents a structured triple of geospatial information, 、 They all represent geographical elements. Representing geographic features and geographical elements The spatial relationship between Represents the encoded text description of the spatial relationship.

[0102] Taking "a certain commercial plaza contains a certain restaurant" as an example, the embodiment of the present invention generates a natural language text as "a certain commercial plaza has everything. If you are tired of shopping, you can go to a certain restaurant to sit down and eat something to replenish your energy. This place is quite lively and there are usually many people there. You have to come early to park, otherwise you won't be able to find a spot even if you walk around for a long time."

[0103] To validate the effectiveness of this method, the present invention first generated 3,000 geospatial information corpora using two different methods as positive samples. Simultaneously, the InstructIE dataset, a general information extraction corpus, was collected as negative samples. Two datasets were constructed in a 1:1 ratio and processed into the Alpaca format. 300 geospatial information corpora generated using the two methods and 600 general information extraction corpora were selected as test sets. One method was generated using the proposed method, while the other was generated using direct prompting. Next, the remaining portions of these two datasets, excluding the test set, were divided into two groups: a small sample (1,200 samples) and a large sample (4,800 samples) to ensure that the training process covered sample distributions of different sizes. Based on this, the ChatGLM3-6B model was selected as the baseline model and trained using instruction-supervised fine-tuning until convergence, resulting in different trained models. Finally, different model accuracy metrics were validated on the test set, demonstrating the effectiveness of the proposed method. The results are shown in Table 1 below.

[0104] Table 1 Verification results

[0105]

[0106] The embodiment of the present invention determines the geographical elements in the study area based on the obtained map service data of the study area, calculates the spatial relationship between the geographical elements, and obtains the structured triples of geographical spatial information; analyzes the obtained geographical spatial information text set corresponding to the study area, forms a text description structure and clusters it to obtain multiple clustering results; identifies the common features of the text description structure in the multiple clustering results, analyzes each clustering result, and obtains the spatial relationship text description form; encodes the spatial relationship text description form, and inputs the geographical spatial information structured triples and the encoded spatial relationship text description into a large language model for expansion based on a prompt template to generate natural language text; The language text is merged with the structured triples of geospatial information to obtain geospatial information samples; compared with the existing technology, the embodiment of the present invention uses spatial relationship calculation to extract structured geospatial triples from map service data, avoiding the high cost and inefficiency of manual annotation; the obtained geospatial information text set corresponding to the study area is analyzed to obtain the spatial relationship text description form, and the geospatial information structured triples and the encoded spatial relationship text description are input into the large language model for expansion based on the prompt template, avoiding the semantic deviation that may be caused by data enhancement, overcoming the limitations of rule templates in processing diverse corpora, and improving the diversity of geospatial information data generation.

[0107] Corresponding to the method for generating geographic space information samples described in the above embodiment, as Figure 2As shown, an embodiment of the present invention further provides a device 100 for generating a geographic space information sample, and the device 100 for generating a geographic space information sample includes:

[0108] An acquisition module 101 is configured to acquire map service data of a study area and determine geographic elements within the study area based on the map service data;

[0109] The calculation module 102 is used to calculate the spatial relationship between geographic elements based on the map service data to obtain structured triples of geographic spatial information;

[0110] The first analysis module 103 is used to analyze the obtained geographic spatial information text set corresponding to the study area to form a text description structure, and cluster the text description structure to obtain multiple clustering results;

[0111] The second analysis module 104 is configured to identify common features of the text description structure in the plurality of clustering results based on the structural features of the geospatial information text set, and analyze each clustering result based on the common features to obtain a spatial relationship text description form;

[0112] An expansion module 105 is configured to encode the spatial relationship text description form and input the geospatial information structured triples and the encoded spatial relationship text description into a large language model. The large language model expands the geospatial information structured triples based on the prompt template and the encoded spatial relationship text description to generate natural language text.

[0113] The merging module 106 is configured to merge the natural language text with the structured triples of geospatial information to obtain a geospatial information sample.

[0114] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0116] The embodiment of the present invention further provides a terminal device, such as Figure 3 As shown, the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 3 Only one processor is shown in the figure), a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 implements the above-mentioned method for generating geospatial information samples when executing the computer program D102.

[0117] The terminal device D10 can be a computing device such as a desktop computer, a notebook, a PDA, a server, a server cluster, a cloud server, etc. The terminal device may include, but is not limited to, a processor D100 and a memory D101. It will be understood by those skilled in the art that Figure 3 This is merely an example of the terminal device D10 and does not constitute a limitation on the terminal device D10 . The terminal device D10 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device D10 may also include input and output devices, network access devices, etc.

[0118] The processor D100 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0119] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may also be an external storage device of the terminal device D10, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device D10. Furthermore, the memory D101 may include both an internal storage unit of the terminal device D10 and an external storage device. The memory D101 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory D101 may also be used to temporarily store data that has been output or is about to be output.

[0120] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0122] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a geographic spatial information sample is implemented.

[0123] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a construction device / terminal device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Examples include a USB flash drive, a removable hard drive, a magnetic disk, or an optical disk.

[0124] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for generating a geographic spatial information sample, characterized in that: include: Step 1: Obtain map service data of a study area, and determine geographic elements within the study area based on the map service data; Step 2: calculating the spatial relationship between the geographic elements based on the map service data to obtain a structured triple of geographic spatial information; Step 3: analyzing the obtained geographic spatial information text set corresponding to the study area to form a text description structure, and clustering the text description structure to obtain multiple clustering results; Step 4: identifying common features of the text description structure in multiple clustering results based on the structural features of the geospatial information text set, and analyzing each clustering result based on the common features to obtain a spatial relationship text description form; Step 5: Encode the spatial relationship text description form, and input the geospatial information structured triples and the encoded spatial relationship text description into a large language model. The large language model expands the geospatial information structured triples based on the prompt template and the encoded spatial relationship text description to generate natural language text. Step 6: Merge the natural language text with the geospatial information structured triples to obtain a geospatial information sample.

2. The method for generating geographic space information samples according to claim 1, wherein: Before determining the geographic elements within the study area based on the map service data, the method further includes: The map service data is format-converted and parsed, and abnormal data is removed to obtain pre-processed map service data, where the abnormal data includes human error standard data and missing data.

3. The method for generating geographic space information samples according to claim 2, wherein: The spatial relationship between the geographic elements is calculated based on the map service data to obtain a structured triple of geographic spatial information, including: Construct a spatial index for all geographic features in the study area through R-tree; Randomly select a geographical element from all geographical elements in the study area as a target geographical element, and obtain neighboring elements whose distance to the target geographical element is less than a preset threshold through the spatial index to form a nearest neighbor candidate set; Randomly selecting a number of neighbor elements from the nearest neighbor candidate set, and calculating the spatial relationship between each neighbor element and the target geographic element, to obtain a calculation result in the form of a triple; Repeatedly select the target geographic feature and calculate the spatial relationship between the target geographic feature selected each time and each neighbor feature to obtain the calculation result in the form of triples; All calculation results in triple form that meet the preservation conditions are saved to obtain structured triples of geospatial information.

4. The method for generating geographic space information samples according to claim 3, wherein: The obtained geospatial information text set corresponding to the study area is analyzed to form a text description structure, including: According to the data characteristics of the geospatial information field, a geospatial information text set corresponding to the research area is obtained from the public information website; Performing part-of-speech tagging on the geospatial information text set using a Qwen-max model to identify geographic entities, action descriptions, and modification information in the geospatial information text set; The grammatical structure of the sentences in the geospatial information text set after part-of-speech tagging is parsed through the dependency tree to form a text description structure.

5. The method for generating geographic space information samples according to claim 4, characterized in that: Clustering the text description structure to obtain multiple clustering results, including: Vectorize the text description structure using the Sentence-BERT model to obtain a high-dimensional text description structure; The high-dimensional text description structure is density clustered using a DBSCAN model to obtain multiple clustering results, each of which contains a group of similar high-dimensional text description structures.

6. The method for generating geographic space information samples according to claim 5, characterized in that: The large language model expands the structured triples of geospatial information based on the prompt template and the encoded spatial relationship text description to generate a natural language text expression: ; in, represents natural language text, Represents a large language model, Represents a structured triple of geospatial information, They all represent geographical elements. Representing geographic features and geographical elements The spatial relationship between Represents the encoded text description of the spatial relationship.

7. A device for generating geographic space information samples, characterized in that: include: An acquisition module, configured to acquire map service data of a study area and determine geographic elements within the study area based on the map service data; A calculation module, configured to calculate the spatial relationship between the geographic elements based on the map service data to obtain a structured triple of geographic spatial information; a first analysis module, configured to analyze the acquired geographic spatial information text set corresponding to the study area to form a text description structure, and cluster the text description structure to obtain a plurality of clustering results; a second analysis module for identifying common features of the text description structure in a plurality of clustering results based on the structural features of the geospatial information text set, and analyzing each clustering result based on the common features to obtain a spatial relationship text description form; an expansion module, configured to encode the spatial relationship text description form, and input the geospatial information structured triples and the encoded spatial relationship text description into a large language model, wherein the large language model expands the geospatial information structured triples based on a prompt template and the encoded spatial relationship text description to generate natural language text; A merging module is used to merge the natural language text with the geospatial information structured triples to obtain a geospatial information sample.

8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for generating a geospatial information sample according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating a geospatial information sample according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Geographic entity space-time knowledge graph ontology library construction method

    CN115269751A

  • Spatial scene spatial relationship natural language description generation method

    CN116049501A