A knowledge base construction and dynamic updating method for automatic assembly of geographic analysis models

By constructing knowledge retrieval templates and event extraction templates based on geographic analysis model description documents, combined with the dynamic update mechanism of user feedback, the automation problem of the construction and update of the knowledge base of geographic analysis model is solved, and the efficiency and flexibility of geographic modeling are improved.

CN119149515BActive Publication Date: 2025-04-01NANJING NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411131688.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2025-04-01
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

It is difficult for the existing technology to realize the intelligent, automated construction and continuous update of the knowledge base of geographic analysis models, resulting in low efficiency in geographic modeling and inability to meet diversified needs.

Method used

By retrieving templates and model event extraction templates based on geographic analysis model description documents, the assembly knowledge base is built, and dynamically updated using user feedback to realize automatic assembly and personalized recommendation of the knowledge base.

Benefits of technology

It realizes the automated construction and dynamic update of the knowledge base of geographic analysis model, improves the efficiency of geographic modeling, and can meet diverse analytical needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149515B_ABST
    Figure CN119149515B_ABST
Patent Text Reader

Abstract

The present invention discloses a knowledge base construction and dynamic update method for automatic assembly of geographic analysis models, including model resource retrieval and information extraction template generation based on geographic analysis model description documents, automatic extraction of geographic analysis model assembly units based on templates and model assembly knowledge base construction, personalized geographic analysis model automatic assembly based on user modeling background and purpose, model assembly knowledge base maintenance and update method based on user feedback, etc. Through this method, model resource representation and model assembly decision behavior can be learned from geographic analysis model description documents, and the generated combined path knowledge base can be used to study previous decision strategies, recommend the next step in the model assembly process, realize automatic assembly of geographic analysis models, improve the efficiency and accuracy of model construction, and ensure the timeliness and accuracy of data in the knowledge base through an online incremental dynamic update mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geographic modeling and simulation, and more specifically to a knowledge base construction and dynamic updating method for automatic assembly of geographic analysis models. Background Art

[0002] Geographic analysis models are increasingly used in many fields such as meteorology, environment, transportation, and planning. However, building a geographic model knowledge base that meets specific analysis needs is a major challenge facing this field.

[0003] The traditional way of building geographic models mainly relies on the accumulation of expert experience and knowledge and manual operation, which results in modelers having to invest a lot of energy in assembling models, resulting in an inefficient process and too much repetitive work. Although there are many modeling tools, they usually lack knowledge base support. In addition, whether it is manual accumulation or tool-assisted methods, the existing technology lacks an effective mechanism to achieve continuous updating of the knowledge base. Therefore, how to break through the bottlenecks of knowledge acquisition, model construction, and knowledge updating, and realize the intelligent and automated construction of the geographic analysis model assembly knowledge base, has become the key to improving the efficiency of geographic modeling and meeting diverse needs.

[0004] The geographic analysis model description document proposed by Zhang Fengyuan et al. is based on extensible markup language. By designing different fields, it completes the description of heterogeneous geographic analysis models, realizes the sharing and reuse of geographic analysis models in description, and also provides underlying support for the automatic construction method of the knowledge base of geographic analysis models. Summary of the invention

[0005] In view of the problems existing in the prior art, the purpose of the present invention is to provide a knowledge base construction and dynamic update method for automatic assembly of geographic analysis models, to provide a solution for the dynamic construction of geographic modeling knowledge base, and to effectively accelerate the development of geographic modeling experiments.

[0006] To solve the above problems, the present invention adopts the following technical solutions.

[0007] A knowledge base construction and dynamic updating method for automatic assembly of geographic analysis models includes the following steps:

[0008] S1. Based on the geographic analysis model description document, construct the model knowledge retrieval template and the model event extraction template;

[0009] S2, building an assembly knowledge base based on the model knowledge retrieval template and the model event extraction template;

[0010] S3, based on the user's modeling needs, search the assembly knowledge base and generate assembly suggestions for the geographic analysis model;

[0011] S4. Based on the assembly suggestion of the geographic analysis model, the assembly modeling steps are recommended to the user, and user feedback is obtained, where the user feedback includes acceptance and correction. If the user feedback is acceptance, the current assembly knowledge base is kept unchanged. If the user feedback is correction, the assembly knowledge base is updated based on the user's correction feedback, and return to S3.

[0012] Further: the step S1 comprises the following steps:

[0013] S1.1 Traverse the geographic analysis model description documents one by one, use the structured document parsing method to extract standardized metadata information from them, and construct a model knowledge retrieval template; wherein the standardized metadata information at least includes the model name, keyword list and model summary description;

[0014] S1.2 Extract model status events from the geographic analysis model description document and construct a model event extraction template; wherein the model status event at least includes a status name, an event name and an event description.

[0015] Further: the step S1.2 specifically includes:

[0016] Parse the geographic analysis model description document at the semantic level, identify various model state events defined in the geographic analysis model description document, and extract the model state event sequence {(S1, E1, D1), (S2, E2, D2), …, (S n ,E n ,D n )} as a model event extraction template; the model state event (S i ,E i ,D i ) indicates that in state S i Next, the event E needs to be carried out i , and event E i description, n represents the number of states.

[0017] Further: the step S2 comprises the following steps:

[0018] S2.1 Based on the model knowledge retrieval template, a seed URL set and a web crawler crawling strategy are constructed to crawl documents related to the geographic analysis model from heterogeneous data sources; wherein the heterogeneous data sources at least include digital document libraries and technical manuals;

[0019] S2.2 For the structured text in the documents related to the geographic analysis model, based on the model event extraction template, the model operation event knowledge is extracted and encoded into a knowledge graph to form a structured semantic library of the assembly knowledge base; for the unstructured text in the documents related to the geographic analysis model, semantic segmentation and vectorization encoding are performed to form an unstructured semantic library of the assembly knowledge base.

[0020] Further: after step S2.1 and before step S2.2, the method further includes:

[0021] For documents related to geographic analysis models, file parsing tools are used to extract text content, and the extracted text content is uniformly converted into plain text format. Redundant and repeated text is identified and removed based on the text fingerprint algorithm.

[0022] Further: the structured semantic library of the assembly knowledge base formed in step S2.2 specifically includes:

[0023] Based on the model event extraction template, a large language model is used to extract model assembly knowledge from documents related to geographic analysis models (S i ,E i ,D i ,K i ), indicating that in state S i Next, the event E needs to be carried out i , and event E i Description of the assembly item;

[0024] The extracted model assembly knowledge is represented as nodes in the knowledge graph, and each node includes: ① node ID, i.e., the unique identifier of the state or event; ② description information, i.e., the description of the state or event; ③ type, i.e., the type of the node;

[0025] Build the relationship between states and events, and represent it as a directed edge in the knowledge graph. Each edge includes: ① starting point, i.e. the starting node ID of the edge; ② end point, i.e. the ending node ID of the edge; ③ relationship type, i.e. the type of edge;

[0026] The assembly items of each event are stored as attributes of the event node. Each assembly item includes: ① assembly item ID, i.e., the unique identifier of the assembly item; ② assembly item description, i.e., the description information of the assembly item;

[0027] Form a structured semantic library of assembly knowledge base.

[0028] Further: the unstructured semantic library of the assembly knowledge base formed in step S2.2 specifically includes:

[0029] Semantically segment the unstructured text in the documents related to the geographic analysis model and divide it into semantically coherent short text fragments to form a sequence of short text fragments.

[0030] Using the pre-trained language model, short text fragment sequences are vectorized and encoded, and their corresponding semantic vector representations are extracted and stored in the vector database to form an unstructured semantic library of the assembly knowledge base.

[0031] Further: the step S3 comprises the following steps:

[0032] S3.1 Obtain the user's modeling requirements, which at least include the model name, research area, analysis objectives, and expected results;

[0033] S3.2 Based on the user's modeling needs, natural language processing technology is used to extract the key elements contained therein (such as the geographic analysis model used, the research area, the geographic problem to be solved, etc.), and it is converted into a structured query expression. Based on the structured query expression, the structured assembly knowledge that meets the query expression is retrieved in the structured semantic library of the assembly knowledge base; based on the key elements in the user's modeling needs, the unstructured context text with the highest semantic similarity to the key elements is retrieved in the unstructured semantic library of the assembly knowledge base; the retrieved structured assembly knowledge is integrated with the unstructured context text, combined with the user's modeling needs, a context scene description is constructed, and the context scene description is converted and encoded into a prompt word;

[0034] S3.3 When the user assembles each step of the geographic analysis model, the large language model is input to generate assembly suggestions based on the current step and the prompt word corresponding to the step to complete the assembly of the geographic analysis model.

[0035] Further: the step S3.3 specifically includes:

[0036] When the user performs the first step of assembling the geographic analysis model, an initial prompt is generated, which includes the user's modeling requirements and a description of the current step. The initial prompt is input into the large language model, and an assembly suggestion for the first step is output;

[0037] After the user completes the first step of assembly, a prompt for the second step is generated. The second prompt includes the user's modeling requirements, current status, the final assembly result of the user in the previous step, and a description of the assembly to be performed in the next step of the model. The second prompt is input into the large language model to generate assembly suggestions for the second step of assembly.

[0038] Repeat the above process to generate prompts for each subsequent step until the entire geographic analysis model is assembled.

[0039] Further: the step S4 comprises the following steps:

[0040] S4.1 Obtain user feedback on assembly suggestions for each assembly step;

[0041] S4.2 If the user feedback is acceptance, there is no need to update the structured semantic library; if the user feedback is correction, natural language understanding technology is used to semantically parse the correction feedback, extract the correction content C, and locate the knowledge entity e that is most similar to C in the structured semantic library. * , update e according to C * The attribute value of is obtained to obtain the updated structured semantic library;

[0042] S4.3 If the user feedback is acceptance, there is no need to update the unstructured semantic library; if the user feedback is correction, extract keywords from C, retrieve the top k vectors most similar to it in the unstructured semantic library, and update the vectors whose distance from C is less than the set threshold among the top k most similar vectors based on C; otherwise, insert new vectors based on C to obtain the updated unstructured semantic library.

[0043] Compared with the prior art, the advantages of the present invention are:

[0044] 1. Ability to automatically build a general geographic analysis model knowledge base

[0045] The retrieval template and model loading information extraction method based on the geographic analysis model description document proposed in the present invention can automatically and efficiently obtain various types of structured and unstructured knowledge related to the geographic analysis model from heterogeneous data sources, solving the problem of the lack of a unified construction process for the geographic modeling knowledge base in the past.

[0046] 2. Dynamic incremental knowledge update capability

[0047] In the interactive process of model automatic assembly, the present invention can obtain user feedback in a timely manner and extract it through semantic analysis, which is then integrated into the knowledge base as an incremental update. This dynamic update mechanism enables the knowledge base to continuously obtain the latest user feedback and keep pace with actual needs;

[0048] 3. Efficient and intelligent knowledge query and integration

[0049] Based on structured query mechanism and natural language processing technology, the present invention can efficiently retrieve structured knowledge and unstructured context descriptions related to user needs from the knowledge base, and fuse them to generate a complete scene context, providing strong support for subsequent intelligent model assembly based on pre-trained language models. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the technical process of the present invention. DETAILED DESCRIPTION

[0051] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention; it is obvious that the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments, and all other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work are within the scope of protection of the present invention.

[0052] The present invention relates to a knowledge base construction and dynamic updating method for automatic assembly of geographic analysis models. Figure 1 As shown, the following steps are included:

[0053] S1. Model resource retrieval and information extraction template generation based on geographic analysis model description documents

[0054] Based on the geographic analysis model description document, the structured document parsing method is used to extract metadata such as model name, keywords, and summary description from it, and a model knowledge retrieval template is constructed to support the subsequent rapid retrieval of resources related to the target model from heterogeneous data sources. Then, the model state events are extracted from the geographic analysis model description document, including information such as state name, event condition name, and event description, and a model event extraction template is constructed. The assembly process of the geographic analysis model is formalized as a step-by-step process to extract structured model operation event knowledge from unstructured model-related resources.

[0055] S1.1 Parsing of geographic analysis model description documents and extraction of standard metadata

[0056] By traversing the geographic analysis model description document nodes, the XML structured document parsing method is used to extract standardized metadata information such as model name, keyword list and model summary description. The extracted metadata will be used to construct the subsequent model knowledge retrieval template.

[0057] S1.2 Iterative extraction of model states and response events

[0058] In the geographic analysis model description document, State represents the running steps of the model, has a unique identifier and description, and can be a basic type or an iterative type. Event is a subset of State, which represents the input and output behavior of the model. Each Event has name and description fields to identify and describe. Each State tag represents a step of the model, and multiple States are placed under the StateGroup tag. The State tag describes the internal process of the step in detail. The Event tag is used to represent the input and output behavior of the model. A State can contain multiple Events, but each Event can only have one input or output.

[0059] The geographic analysis model description document is parsed at the semantic level to identify the various model event responses defined in the document, that is, what events the model needs to perform in the current state, and the description of the event. The model description document is further formalized as a series of states, events, descriptions S1, E1, D1, S2, E2, D2, ..., S n ,E n ,D n , thereby capturing the dependencies in the assembly process and predicting the next step given the context. This method is inspired by the token generation strategy in the natural language field and formalizes the model assembly decision behavior of the geographic analysis model into a step-by-step procedure, mapping the model assembly problem at the current step to the prediction problem of the next step.

[0060] S1.3 Information extraction template generation

[0061] Extract the model event sequence {(S1, E1, D1), (S2, E2, D2), …, (S n ,E n ,D n )} as a model event extraction template. Based on this template, an information extraction template is generated for each step of model assembly behavior to guide the subsequent extraction of relevant knowledge such as method selection and parameter setting in the modeling process from unstructured text. For different steps of model assembly, corresponding natural language prompt words are constructed. The general form of prompt words can be expressed as:

[0062]

[0063] The System part explains the background and purpose of this extraction task, and requires the model to think in a chain of thought to improve the accuracy of the model; the User part shows how to gradually extract the settings of each stage and event in the geographic analysis model description document from the given text, and generate corresponding questions in the form of user messages. The main function of this pseudocode is to construct a series of user messages through an iterative process to guide the generation of information extraction templates and the extraction of model assembly knowledge.

[0064] S2. Automatic extraction of geographic analysis model assembly units and construction of model assembly knowledge base based on templates

[0065] According to the S1 model knowledge retrieval template, we build seed URLs and crawler strategies to crawl geographic analysis model-related documents from heterogeneous data sources. Based on the S1 model event extraction template, we identify model operation event knowledge that meets the event extraction template rules from the text. Then we encode the knowledge into a knowledge graph, import it into the graph database for storage, and build a structured semantic library. For unstructured text that does not meet the event extraction template rules, we perform semantic segmentation and divide it into short text fragments. We use the text-embedding-ada-002 model for vector encoding, store the semantic encoding in the vector database, and build an unstructured semantic library.

[0066] S2.1 Heterogeneous Source Data Collection

[0067] Based on the <model name, keyword list, model summary> attribute template extracted in step S1.1, a seed URL set and a web crawler crawling strategy are constructed to download various original document file resources related to the model from heterogeneous online data sources including professional websites, digital document libraries, technical manuals, etc.

[0068] S2.2 Raw file preprocessing

[0069] For the downloaded original file resources, the Apache Tika file parsing tool is used to extract the text content from the original document; then the extracted text content is uniformly converted into plain text format; finally, based on the text fingerprint algorithm, redundant repeated text is identified and removed.

[0070] S2.3 Knowledge extraction and knowledge base construction

[0071] Based on the model event extraction template extracted in step S1.3, semantic extraction is performed on the text after redundancy removal. The specific steps are to combine the model event extraction template proposed in S1.3, use the GPT-4o large language model, and extract the model assembly knowledge K from all text paragraphs of the crawled file resources in S3.1.

[0072] The model assembly knowledge K is the semantically clear content in the preprocessed text set, which can be used to directly guide the assembly of the model under a certain event. The assembly steps and their corresponding assembly knowledge can be formalized as states, events, descriptions, and assembly items S1, E1, D1, K1, S2, E2, D2, K2, …, S n ,E n ,D n ,K n , that is, each model assembly event E i It can be expressed as S i , E i , D i , K i A collection of .

[0073] The extracted states and events and their assembly knowledge are represented as nodes in the knowledge graph to be constructed. Each node includes the following attributes: Node ID: unique identifier of the state or event, description information: description of the state or event, type: type of node (State or Event). Next, the relationship between states and events is constructed and represented as a directed edge in the knowledge graph. Each edge includes the following attributes: starting point: the starting node ID of the edge, end point: the ending node ID of the edge, relationship type: the type of edge (such as "hasEvent" or "leadsTo"). Finally, the assembly item knowledge of each event is stored as attributes of the event node. Each assembly item includes the following attributes: assembly item ID: unique identifier of the assembly item, assembly item description: description information of the assembly item, and assembly item attributes are added to the event node to ensure the association between the assembly item and the event. For example: event node ID: E1, assembly item attribute: K1. Through the above parts, the structured knowledge base part of the assembly knowledge base can be formed.

[0074] For the semantically complex and difficult-to-structure texts in the preprocessed text set, the TextRank algorithm is used to automatically segment them based on semantic relevance and divide them into semantically coherent short text fragments. Then, the text-embedding-ada-002 pre-trained language model is used to vectorize the text fragment sequence, extract its corresponding semantic vector representation, and store the vector in the Chromadb vector database to form the unstructured semantic library part of the assembly knowledge base.

[0075] S3. Automatic assembly of personalized geographic analysis models based on user modeling background and purpose

[0076] Design user modeling context templates and let users fill in the templates to obtain the modeling requirements described in natural language. Use natural language processing technology to extract key elements related to geographic analysis model assembly (such as the geographic analysis model used, the research area, the geographic problems to be solved, etc.) and convert them into structured query expressions. Retrieve structured knowledge and unstructured text content that meet the query conditions in the model assembly knowledge base based on the structured query expression. Fuse the extracted key entities with the retrieved content to build a complete scene description, and convert it into a semantic prompt input into the large language model. The large language model performs reasoning based on the scene description and generates a natural language assembly plan that meets user needs. The system performs structured analysis on the assembly plan, extracts step-by-step operation instructions, parameter settings, etc., and forms an executable geographic analysis model assembly plan.

[0077] It should be noted that the keyword list in the previous article is the keywords used to describe the model in the geographic analysis model description document. The key elements here refer to the modeling-related elements in the user's modeling requirements, such as what model to use, where the research area is, what problems to solve, etc.

[0078] S3.1 User demand acquisition and standardization

[0079] Provide a natural language interactive interface to obtain the user's modeling requirements, including model name, research area, analysis objectives, expected results and other related descriptions, and generate the user's modeling background context information.

[0080] S3.2 Step-by-step assembly knowledge retrieval

[0081] Based on the user modeling requirement description, natural language processing technology is used to extract the key entities contained therein, such as model name, analysis goal, research area, etc., and convert them into structured query expressions, such as "SELECT*FROMKnowledgeBase WHERE ModelName='Model name'AND AnalysisGoal='Analysis goal'ANDRegion='Research area'". Based on the structured query expression, the graph database part of the assembly knowledge base is retrieved to obtain structured assembly knowledge that meets the query expression, including structured knowledge such as model parameter configuration, execution rules, and data input and output constraints. At the same time, based on the keywords in the user requirements, the vector database part of the assembly knowledge base is retrieved to obtain the unstructured context text with the highest semantic similarity to the keywords. The retrieved structured assembly knowledge is integrated with the unstructured text information, and combined with the natural language requirement description initially input by the user to construct a context scenario description, covering information such as user requirements, geographical area characteristics, model configuration parameters, and data constraints. Subsequently, the scenario description is converted and encoded into a prompt word.

[0082] S3.3 Step-by-step model assembly prompt generation

[0083] When the user assembles each step of the model, the system will input the large language model to generate assembly suggestions based on the current step and the encoded prompt word. When assembling the first state and event of the model, an initial prompt is generated, which includes the user's modeling context and a description of the current step. The initial prompt is input into the large language model, and the model outputs the assembly suggestion for the first step. The generated suggestion content includes specific operation instructions and parameter configuration. The formula is expressed as:

[0084] prompt i = {U,Si,(S i-1 ,E i-1 ,Di-1 ),K}

[0085] Among them, U is user demand, Si is the current state, E i For current events, D i is the current description, and K is the knowledge base suggestion.

[0086] After the user completes the first step of assembly, the system enters the second step. The second prompt is generated, which includes the user's modeling context, current status, previous step assembly status, and next step assembly suggestions in the knowledge base. The second prompt is input into the large language model to generate the second step assembly suggestion. The user completes the assembly according to the suggestion, and the above process is repeated to generate prompts for each subsequent step until the entire model assembly is completed.

[0087] S3.4 Step-by-step model assembly reasoning

[0088] The large language model will comprehensively consider all contextual scene information such as the user's original needs, geographical area characteristics, and structured and unstructured assembly knowledge in the knowledge base, and generate a detailed assembly solution description in natural language form based on the target probability of maximizing P (assembly solution | user needs, knowledge base content), including step-by-step operation instructions, model configuration parameters, etc. That is, given user needs U, structured knowledge Ks, and unstructured knowledge K u , the goal is to generate the optimal model assembly solution M * :

[0089]

[0090] Among them, P(M|U,Ks,K u ) is the conditional probability distribution of the model assembly scheme M under known conditions, which is modeled and sampled by the language model based on the context scene description.

[0091] S4. Model assembly knowledge base maintenance and update method based on user feedback

[0092] Recommend assembly modeling steps to users based on the assembly plan of the geographic analysis model, and obtain user feedback (acceptance / correction). Perform semantic analysis on the correction feedback, identify the intent, and extract the correction suggestion content. Based on the feedback intent and suggestions, locate the corresponding key entities in the knowledge graph and perform incremental updates. At the same time, extract keywords from the feedback, retrieve the most similar text vectors in the vector database, and determine whether to expand or replace unstructured knowledge based on the semantic distance. Regenerate the assembly plan based on the updated knowledge base, form a closed-loop interaction, and integrate artificial experience to gradually optimize the knowledge base.

[0093] S4.1 User feedback acquisition

[0094] In the process of automatic model assembly, each assembly step is described in detail according to the geographic analysis model description document, and the current recommended assembly step is displayed to the user. The user's feedback (acceptance / correction) on this recommended step is obtained through the natural language interaction interface.

[0095] S4.2 Structured knowledge updating

[0096] If the user feedback is acceptance, there is no need to update the structured knowledge base. If the user feedback is correction, natural language understanding technology is used to semantically parse the correction feedback and extract the correction content C. The knowledge entity e* most relevant to C is located in the graph database and the similarity score is calculated:

[0097] score(e * ,C)=sim(f(e * ),C)

[0098] Among them, f(e * ) is the knowledge representation function of entity e, and sim(*) is the similarity function. According to C, update e * The attribute value of is obtained to obtain the updated structured knowledge base.

[0099] S4.3 Unstructured Knowledge Update

[0100] If the user feedback is acceptance, there is no need to update the unstructured semantic library. If the user feedback is correction, then: extract key elements (such as the model used, the geographical problem faced, etc.) from the correction content C, retrieve the top k vectors V that are most similar to it in the unstructured semantic library, and calculate each v i ∈V and the distance between the correction content C, set the distance threshold θ, if the calculated distance is less than the threshold θ, update v according to C i Corresponding text vector; otherwise, C is converted into a vector representation and inserted into the unstructured semantic library to obtain an updated unstructured semantic vector library.

[0101] S4.4 Model iterative reasoning

[0102] Based on steps S4.2 and S4.3, the language model reasoning process in step S3 is rerun based on the updated structured and unstructured knowledge base to generate a new assembly plan that is more in line with the user's feedback intention. In practical applications, step S4.1 can be repeated to obtain the next round of user feedback on the new plan, forming a closed-loop human-computer interactive knowledge accumulation and reasoning model optimization process, continuously integrating human experience, and enhancing the automated assembly capability of the geographic analysis model.

[0103] Example:

[0104] The present invention proposes a retrieval template and model filling information extraction method based on geographic analysis model description document, and its specific implementation steps are as follows:

[0105] 1. In step S1, parse the description document of the SWAT model. Use xml.etree.ElementTree to parse the module and locate <modelclass>Node, extract name attribute information, locate <attributeset>Node, Extract <category> 、 <localattribute>The Keywords, Abstract and other attribute information of the child nodes are extracted to construct a structured model metadata object, such as:

[0106]

[0107] Based on the extracted model metadata, a retrieval query template is constructed for subsequent retrieval of resources related to the SWAT model in unstructured data sources such as scientific literature. The template is in the form of: "SWAT" AND ("Water" OR "Soil" OR "Prediction") AND "model" AND "watershed". A URL retrieval template is generated for subsequent web crawlers. The template is in the form of: "http: / / swat.tamu.edu / " AND "model" AND "document" AND "filetype:pdf".

[0108] Next, extract the SWAT model status and event information and locate the XML document <stategroup>Node, traverse its <state>Child nodes, for each <state>Node, extract name, description and other attribute information, locate <state>of <event>Child nodes, extract attribute information such as name and description, and construct the extracted State and Event information into a structured state event object, such as:

[0109]

[0110] Based on the extracted State and Event information, a series of regular expression templates are constructed to be used to extract knowledge fragments related to specific SWAT model events from unstructured texts. For example, the extraction template for DEM events: Given the text content: context, how are the events of the model set up in the DEM data loading stage? The extraction template for D8 events: Given the text content: context; how are the events of the model set up in the D8 flow calculation stage?

[0111] 2. In step S2, crawl SWAT-related unstructured text resources, input the URL retrieval template generated in step 1.2 into the customized crawler program, and the crawler program searches and downloads SWAT-related unstructured text resources in PDF, HTML, Word and other formats according to the URL template, archives the downloaded text resources as a local original corpus, and calls the Apache Tika library to extract the plain text content of the PDF, Word and other format documents in the original corpus, performs sentence processing on the extracted text content, calls the NLTK toolkit to perform sentence segmentation on the text, preprocesses the segmented sentences, removes stop words, punctuation marks, special characters, etc., and restores the word form to the stem form, filters out sentences whose number of characters after preprocessing is lower than a certain threshold, retains meaningful content, and performs hash deduplication on the processed sentences to obtain the preprocessed corpus.

[0112] Apply the event extraction template constructed in step 1.4 to the preprocessed corpus. For each sentence in the corpus, use each event extraction template to extract knowledge. If the match is successful, the sentence is extracted as a knowledge fragment corresponding to the SWAT model event. Then, the SWAT model state State extracted in step 1.3 is used as the node of the knowledge graph, and the node attributes include stateName and stateDescription. The event Event under the state State is another type of node in the knowledge graph, and the node attributes include name and description. A "belongTo" relationship is established between the Event node and the State node, indicating that an event belongs to a certain state. For each Event node, the corresponding knowledge fragment extracted in step 2.3 is associated as the "eventKnowledge" attribute of the event node. For two adjacent States, a "nextState" relationship is established to indicate the order between the states. The nodes and relationship information of the above knowledge graph are stored in the Neo4j graph database.

[0113] 3. In step S3, the SWAT modeling requirements input by the user in natural language are received, for example: "I want to use the SWAT model to simulate the 2,000 square kilometers of the upper reaches of the Yangtze River and analyze the daily changes in runoff from 2010 to 2020", identify the key semantic elements in the modeling requirements, such as: study area: "upper reaches of the Yangtze River", basin area: "2,000 square kilometers", start and end time: "2010 to 2020", time step: "daily", target variable: "runoff", and construct the extracted semantic elements into a structured modeling requirement object, for example:

[0114] {

[0115] "region":"Upper reaches of the Yangtze River",

[0116] "area":"2000 square kilometers",

[0117] "startTime":"2010-01-01",

[0118] "endTime":"2020-12-31",

[0119] "timeStep":"1",

[0120] "objective":"Flow rate"

[0121] }

[0122] Retrieve relevant modeling events in the SWAT model knowledge graph and map the extracted key semantic elements into the conditions of the Cypher graph database query statement, for example:

[0123] MATCH(s:State)-[:hasEvent]->(e:Event)

[0124] WHERE e.eventKnowledge=~'.*Yangtze River.*'AND e.eventKnowledge=~'.*Flow rate.*'

[0125] RETURN s,e

[0126] Execute Cypher query to retrieve the State nodes and Event nodes related to the user's modeling needs in the knowledge graph, and construct the retrieved State nodes and Event nodes into a subgraph to represent the candidate SWAT modeling process that meets the user's modeling needs. Map the key event nodes (such as flow calculation events) of the retrieved candidate modeling process to the query vector in the vector index, perform K-nearest neighbor similarity search in chromadb, find the Top-K event nodes most similar to the query vector, and use the State nodes corresponding to the retrieved Top-K event nodes as the optimized modeling process skeleton. According to the "nextState" relationship of the State node in the knowledge graph, complete the missing intermediate State nodes in the process skeleton to obtain a complete SWAT modeling process with the highest similarity to user needs.

[0127] The optimized SWAT modeling process is represented as an ordered sequence of a series of State nodes and Event nodes. For each node in the sequence, its stateDescription or eventDescription attribute is obtained as the natural language description corresponding to the node. A large language generation model such as GPT-3 is used to generate a transitional text that connects the semantics of the node before and after the node with the natural language description of the node as a prompt, making the description of the entire modeling process more coherent and natural. The generated natural language description is spliced ​​into a complete SWAT model automatic assembly solution document in the order of the modeling process, for example:

[0128] 1. Basin division stage:

[0129] 1.1 Load the DEM data of the study area and check whether the projection coordinate system and spatial resolution of the DEM data meet the requirements

[0130] 1.2 Fill the DEM data to ensure that the depression pixels are reasonably assigned

[0131] 1.3 Using the D8 algorithm to calculate the flow direction and cumulative flow of DEM data

[0132] 1.4 Set the runoff accumulation threshold to extract the river network and optimize the threshold of the river network

[0133] 1.5 Based on the river network and DEM, divide the sub-basin and calculate the terrain parameters of the sub-basin

[0134] 2. Hydrological response unit stage:

[0135] 2.1 Load the land use data and soil type data of the study area and perform overlay analysis with the sub-basin boundaries

[0136] 2.2 Set the grouping thresholds of land use and soil properties and extract the hydrological response unit HRU

[0137] 2.3 Calculate the area, slope, aspect and other attribute parameters of each HRU

[0138] 3. Meteorological data preparation stage:

[0139] 3.1 Load daily rainfall, temperature and other meteorological observation data of the study area from 2010 to 2020

[0140] 3.2 Perform quality control and interpolation on meteorological data to generate meteorological driving data required by the model

[0141] 4. SWAT model operation phase:

[0142] 4.1 Based on the model input data prepared in steps 1-3, assemble the model in the SWAT model interface

[0143] 4.2 Set the simulation start and end time of the model to 2010-01-01 to 2020-12-31, with a time step of 1 day

[0144] 4.3 Set the model's runoff calculation method to SCS curve number method

[0145] 4.4 Run the SWAT model to generate daily runoff simulation results

[0146] 4.5 Deriving daily flow data at sub-basin and HRU scale for subsequent analysis and evaluation

[0147] 4. In step S4, at each key node of the model assembly scheme execution, a feedback interface pops up, allowing the user to choose "Accept" or "Modify". If the user chooses "Accept", the next step is executed directly. If the user chooses "Modify", a text box pops up to allow the user to enter modification opinions, such as "The land use grouping threshold in step 2 is too large to accurately extract HRU. Please change it to 0.1". Parse user feedback and update the knowledge graph. Use a rule-based text parsing method to extract key information from the user's modification opinions, match the extracted key information with the State node and Event node in the knowledge graph, and locate the target node that needs to be updated. For example: the modification opinions mention "Step 2" and " HRU", then locate the "HydroResponseUnitState" node. If the modification opinion mentions "land use grouping threshold", then locate the "Landuse" event node under the "HydroResponseUnitState" node. According to the specific parameter values ​​in the modification opinion, update the properties of the target node. For example, update the "thresholds" property of the "Landuse" event node to "0.1". If the modification opinion involves new operation steps or parameters, insert a new State node or Event node in the knowledge graph, establish the corresponding relationship edge, and synchronize the updated knowledge graph to the Neo4j database.

[0148] Based on the updated knowledge base, an iteratively optimized SWAT model automatic assembly scheme is regenerated, the new assembly scheme is presented to the user, a new round of user feedback is collected, and the SWAT model assembly knowledge base and assembly scheme are iteratively optimized.

[0149] The invention discloses a knowledge base construction and dynamic update method for automatic assembly of geographic analysis models, belonging to the field of geographic information system technology. The method includes the steps of model resource retrieval and information extraction template generation based on geographic analysis model description documents, automatic extraction of geographic analysis model assembly units and model assembly knowledge base construction based on templates, personalized geographic analysis model automatic assembly based on user modeling background and purpose, and model assembly knowledge base maintenance and update method based on user feedback. Through this method, model resource representation and model assembly decision behavior can be learned from the geographic analysis model description document, and the generated combined path knowledge base can be used to study the previous decision strategy, recommend the next operation in the model assembly process, realize the automatic assembly of geographic analysis models, improve the efficiency and accuracy of model construction, and ensure the timeliness and accuracy of data in the knowledge base through an online incremental dynamic update mechanism. The method is applicable to the fields of geographic information analysis, urban planning, environmental monitoring, etc. The geographic analysis model knowledge base constructed by the method can realize the systematic organization and orderly association reasoning of geographic analysis model assembly knowledge, thereby providing comprehensive, accurate and efficient knowledge support for geographic analysis in related fields.< / event> < / state> < / state> < / state> < / stategroup> < / localattribute> < / category> < / attributeset> < / modelclass>

Claims

1. A knowledge base construction and dynamic updating method for automatic assembly of geographic analysis models, characterized by: The following steps are involved: S1. Based on the geographic analysis model description document, construct the model knowledge retrieval template and the model event extraction template; S2, building an assembly knowledge base based on the model knowledge retrieval template and the model event extraction template; S3, based on the user's modeling needs, search the assembly knowledge base and generate assembly suggestions for the geographic analysis model; S4, based on the geographic analysis model assembly suggestion, recommend assembly modeling steps for the user and obtain user feedback, where the user feedback includes acceptance and correction. If the user feedback is acceptance, the current assembly knowledge base is kept unchanged; if the user feedback is correction, the assembly knowledge base is updated based on the user's correction feedback, and return to S3; Wherein, the step S3 comprises the following steps: S3.1 Obtain the user's modeling requirements, which at least include the model name, research area, analysis objectives, and expected results; S3.2 Based on the user's modeling needs, use natural language processing technology to extract the key elements contained therein, convert them into structured query expressions, and based on the structured query expressions, retrieve structured assembly knowledge that meets the query expressions in the structured semantic library of the assembly knowledge base; based on the key elements in the user's modeling needs, retrieve the unstructured context text with the highest semantic similarity to the keyword in the unstructured semantic library of the assembly knowledge base; merge the retrieved structured assembly knowledge with the unstructured context text, combine with the user's modeling needs, construct a context scene description, and convert and encode the context scene description into a prompt word; S3.3 When the user performs each step of assembling the geographic analysis model, according to the prompt words corresponding to the current step and step S3.2, the large language model is input to generate assembly suggestions to complete the assembly of the geographic analysis model; The step S3.3 specifically includes: When the user performs the first step of assembling the geographic analysis model, an initial prompt is generated, which includes the user's modeling requirements and a description of the current step. The initial prompt is input into the large language model, and an assembly suggestion for the first step is output; After the user completes the first step of assembly, a prompt for the second step is generated. The prompt for the second step includes the user's modeling requirements, current status, the final assembly result of the user in the previous step, and a description of the assembly to be performed in the next step of the model. The second prompt is input into the large language model to generate assembly suggestions for the second step. Repeat the above process to generate prompts for each subsequent step until the entire geographic analysis model is assembled; The step S4 comprises the following steps: S4.1 Obtain user feedback on assembly suggestions for each assembly step; S4.2 If the user feedback is acceptance, there is no need to update the structured semantic library; if the user feedback is correction, natural language understanding technology is used to semantically parse the correction feedback, extract the correction content C, and locate the knowledge entity e that is most similar to C in the structured semantic library. * , update e according to C * The attribute value of is obtained to obtain the updated structured semantic library; S4.3 If the user feedback is acceptance, there is no need to update the unstructured semantic library; if the user feedback is correction, extract the key elements from C, retrieve the top k most similar vectors in the unstructured semantic library, and update the vectors whose distance from C is less than the set threshold among the top k most similar vectors according to C; otherwise, convert C into a vector representation and insert it into the unstructured semantic library to obtain the updated unstructured semantic library.

2. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 1, characterized in that: The step S1 comprises the following steps: S1.1 Traverse the geographic analysis model description documents one by one, use the structured document parsing method to extract standardized metadata information from them, and construct a model knowledge retrieval template; wherein the standardized metadata information at least includes the model name, keyword list and model summary description; S1.2 Extract model status events from the geographic analysis model description document and construct a model event extraction template; wherein the model status event at least includes a status name, an event name and an event description.

3. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 2, characterized in that: The step S1.2 specifically includes: Parse the geographic analysis model description document at the semantic level, identify various model state events defined in the geographic analysis model description document, and extract the model state event sequence {(S1, E1, D1), (S2, E2, D2), …, (S n ,E n ,D n )} as a model event extraction template; the model state event (S i ,E i ,D i ) indicates that in state S i Next, the event E needs to be carried out i , and event E i description, n represents the number of states.

4. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 1, characterized in that: The step S2 comprises the following steps: S2.1 Based on the model knowledge retrieval template, a seed URL set and a web crawler crawling strategy are constructed to crawl documents related to the geographic analysis model from heterogeneous data sources; wherein the heterogeneous data sources at least include digital document libraries and technical manuals; S2.2 For the structured text in the documents related to the geographic analysis model, based on the model event extraction template, the model operation event knowledge is extracted and encoded into a knowledge graph to form a structured semantic library of the assembly knowledge base; for the unstructured text in the documents related to the geographic analysis model, semantic segmentation and vectorization encoding are performed to form an unstructured semantic library of the assembly knowledge base.

5. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 4, characterized in that: After step S2.1 and before step S2.2, the method further includes: For documents related to geographic analysis models, file parsing tools are used to extract text content, and the extracted text content is uniformly converted into plain text format. Redundant and repeated text is identified and removed based on the text fingerprint algorithm.

6. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 4, characterized in that: The structured semantic library of the assembly knowledge base formed in step S2.2 specifically includes: Based on the model event extraction template, a large language model is used to extract model assembly knowledge from documents related to geographic analysis models (S i ,E i ,D i ,K i ), indicating that in state S i Next, the event E needs to be carried out i , and event E i Description of the assembly item; The extracted model assembly knowledge is represented as nodes in the knowledge graph, and each node includes: ① node ID, i.e., the unique identifier of the state or event; ② description information, i.e., the description of the state or event; ③ type, i.e., the type of the node; Build the relationship between states and events, and represent it as a directed edge in the knowledge graph. Each edge includes: ① starting point, i.e. the starting node ID of the edge; ② end point, i.e. the ending node ID of the edge; ③ relationship type, i.e. the type of edge; The assembly items of each event are stored as attributes of the event node. Each assembly item includes: ① assembly item ID, i.e., the unique identifier of the assembly item; ② assembly item description, i.e., the description information of the assembly item; Form a structured semantic library of assembly knowledge base.

7. The method for constructing and dynamically updating a knowledge base for automatic assembly of geographic analysis models according to claim 4, characterized in that: The unstructured semantic library forming the assembly knowledge base in step S2.2 specifically includes: Semantically segment the unstructured text in the documents related to the geographic analysis model and divide it into semantically coherent short text fragments to form a sequence of short text fragments. Using the pre-trained language model, short text fragment sequences are vectorized and encoded, and their corresponding semantic vector representations are extracted and stored in the vector database to form an unstructured semantic library of the assembly knowledge base.

Citation Information

Patent Citations

  • Knowledge base construction method and question and answer dialogue method and system based on generative large language model

    CN117056471A

  • Equipment use and maintenance knowledge base integrated with intelligent learning function

    CN117271700A