Intelligent question and answer method for large language model in planning field
By constructing a knowledge base in the planning domain and employing multi-stage semantic retrieval and online data fusion, the problems of semantic understanding and knowledge structuring of urban planning documents were solved, achieving high-precision question answering and traceability of multi-source knowledge, thereby improving the accuracy and reliability of urban planning decisions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-15
AI Technical Summary
The existing urban planning documents suffer from insufficient semantic understanding, low level of knowledge structuring, inadequate understanding of professional terminology, poor traceability of search results, and inability to support complex question-and-answer or reasoning queries, thus limiting the application value of intelligent planning decision-making.
A knowledge base for the local planning domain is constructed, employing recursive semantic segmentation and semantic tag generation, combined with multi-stage semantic retrieval and online data fusion. High-precision question answering is achieved through a large language model, including page number positioning and vectorized storage, supporting the traceability and dynamic updating of multi-source knowledge.
It achieves high-precision semantic retrieval, multi-source knowledge fusion, knowledge traceability, and contextual integration and closed-loop optimization of intelligent question answering, thereby improving retrieval accuracy and reliability and meeting the real-time decision-making needs of the planning field.
Smart Images

Figure CN122045221A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of urban planning, and in particular to an intelligent question-answering method based on a large language model in the planning field. Background Technology
[0002] Urban planning, land use, and infrastructure construction are crucial areas supporting sustainable urban development. Related research and practice require comprehensive consideration of social, economic, ecological, transportation, and energy factors. With the development of information and digital technologies, a large number of planning outcomes, policies, regulations, technical standards, and research reports are widely stored and disseminated in electronic document form. These documents cover multiple levels, including urban master plans, detailed regulatory plans, land use plans, urban renewal schemes, and transportation construction plans, forming a vast, multi-source, heterogeneous planning knowledge system. In the current urban governance system, relevant departments and researchers often need to quickly obtain and compare key information from documents from different sources to support decision-making activities such as spatial layout optimization, planning evaluation, policy formulation, and project approval. Therefore, how to efficiently extract information and achieve semantic understanding from massive amounts of planning documents has become an important direction for smart city and intelligent planning research.
[0003] Existing technologies for document semantic understanding and knowledge acquisition in fields such as urban planning and land use mainly suffer from the following deficiencies and problems: Insufficient semantic understanding: Traditional keyword-based retrieval or rule-matching methods can only perform shallow text comparisons and cannot understand the complex semantic logic and contextual relationships within documents. For example, in planning specifications or regulations, the same term may have different semantic meanings in different chapters, and existing technologies cannot accurately identify these semantic differences, leading to inaccurate or semantically ambiguous search results.
[0004] Low degree of knowledge structuring: Due to the diverse formats and complex structures of planning documents (such as the mixture of charts, appendices, legal clauses, etc.), existing text processing systems have difficulty automatically converting unstructured text into a computable and traceable knowledge structure, which limits subsequent knowledge reasoning and question answering applications.
[0005] Insufficient understanding of professional terminology and normative logic: The planning field contains a large number of professional terms and symbolic expressions, such as "detailed regulatory planning," "primary land development," and "floor area ratio adjustment." These terms may imply different policy logics and operational requirements in different document contexts. Traditional methods lack contextual awareness of terminology and cannot establish semantic connections between terms.
[0006] The existing search results suffer from poor traceability and low intelligence: Most systems output string matching results, lacking the ability to trace the source of the results, the origin of the clauses, and the contextual interpretation, making it difficult to meet the planning department's demand for "accurate, real-time, and traceable" information services. Furthermore, existing search methods cannot support complex question-and-answer or reasoning queries, limiting their application value in intelligent planning decision-making. Summary of the Invention
[0007] To address the shortcomings of existing technologies, the present invention aims to provide an intelligent question-answering method using a large language model in the planning domain. This method solves the problems of poor semantic understanding, low knowledge structuring, and poor traceability in existing question-answering systems for the planning domain. It achieves high-precision question answering through local knowledge base construction, multi-stage semantic retrieval, online data fusion, and intelligent question-answer generation. To achieve the above-mentioned objectives and other advantages of the present invention, an intelligent question-answering method using a large language model in the planning domain is provided, comprising: (1) Knowledge base construction Multi-source document parsing: Receives various document types such as planning reports, policies and regulations, PPTs, and web pages, and parses them into standard text.
[0008] Semantic segmentation and tag generation: A recursive semantic segmentation algorithm is used to split long texts into knowledge fragments, and semantic tags are generated through a domain-specific large language model.
[0009] Page number location and vectorized storage: Each segment is bound to the original page number and encoded as a high-dimensional vector and stored in a vector database to realize searchable and traceable knowledge entries.
[0010] (2) Multi-stage semantic retrieval Initial screening: Vectorized query matching of knowledge base vectors to quickly filter candidate segments.
[0011] Context expansion: Merge the text before and after the fragment to ensure semantic integrity.
[0012] Semantic reordering and keyword enhancement: Candidate fragments are reordered using Sentence-Transformer and optimized for ranking based on keyword coverage, outputting a set of highly relevant fragments. (3) Online retrieval and knowledge fusion Automatically acquire real-time documents (government websites, search engines, etc.), structure them, and unify vector encoding with the local knowledge base to achieve multi-source fusion retrieval.
[0013] (4) Intelligent question and answer generation Search source selection: The large language model determines the optimal data source.
[0014] Context integration: Deduplication and concatenation of candidate fragments in logical order.
[0015] Answer generation and optimization: Generate well-organized, logically complete answers with source annotations.
[0016] Closed-loop feedback: If the answers are insufficient, the search source is automatically switched or the question is recorded for knowledge base updates and model optimization.
[0017] (5) Technical effects Through the above technical solution, the present invention achieves the following: High-precision semantic retrieval and question answering; Multi-source knowledge fusion and dynamic updating; Knowledge is traceable, and answers are verifiable; Context integration and closed-loop optimization of intelligent question answering.
[0018] Compared with the prior art, the advantages and positive effects of the present invention are: 1. High-precision semantic retrieval: Through vectorized representation, multi-stage retrieval, context expansion, and keyword enhancement, the system achieves accurate semantic matching for long texts and cross-chapter planned documents, significantly improving retrieval accuracy and recall. The system can capture deep semantic relationships between technical terms, mitigating information omissions caused by document segmentation or missing context.
[0019] 2. Multi-source knowledge fusion: This mechanism unifies the processing of local knowledge bases and online real-time documents, ensuring semantic consistency across multiple information sources and supporting cross-source integration and sorting, thereby improving information coverage and relevance. This mechanism can efficiently fuse knowledge fragments from heterogeneous data sources, ensuring the question-answering system maintains consistency and reliability when facing policy updates or changes in online information.
[0020] 3. Automated Structured Knowledge: Employing recursive semantic segmentation, semantic tag generation, and page number positioning, the system achieves structured storage and traceable management of complex documents, improving knowledge itemization and retrieval efficiency. The system can automatically identify clauses, indicator constraints, and document hierarchical structures, providing high-quality knowledge input for downstream retrieval and question answering.
[0021] 4. Intelligent Question Answering and Context Integration: Based on a large language model, the system automatically selects search sources and integrates highly relevant fragments to generate natural language answers, ensuring clarity, logical completeness, and annotation of source information. Through context splicing and deduplication of repetitive content, the system ensures that answers maintain professionalism while improving readability and usability.
[0022] 5. Dynamic Closed-Loop Optimization: When initial search results are insufficient, the system automatically switches search sources and regenerates answers, forming a closed-loop feedback loop to improve the completeness and reliability of question-and-answer sessions. This mechanism also records unanswerable questions, providing data support for knowledge base updates and model tuning, and enhancing the system's continuous improvement capabilities.
[0023] 6. Real-time performance and scalability: Supports dynamic updates of multiple document types and online data sources, balancing professionalism and business adaptability to meet the needs of information growth and real-time decision-making in the planning field. The system can quickly respond to new knowledge sources, enabling incremental expansion of the knowledge base, while ensuring stable and efficient operation of the question-and-answer system in multiple scenarios. Attached Figure Description
[0024] Figure 1 This is a flowchart of the intelligent question-answering method for a large language model in the planning domain according to the present invention. Detailed implementation The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Reference Figure 1 A large language model-based intelligent question answering method for the planning domain, comprising: 1.1 Constructing a local planning domain knowledge base: This invention addresses the characteristics of planning documents, such as diverse sources, complex content structures, and dense technical terms. It proposes a knowledge structuring method for heterogeneous documents to achieve a knowledge base that can be understood and retrieved by large models.
[0026] The system first receives multi-source planning knowledge data. The data types include, but are not limited to, PDF reports, planning texts, policy regulations, Word documents, PPT presentation materials, and plain text files. First, the documents are uniformly parsed to obtain the original text set: , 1.1.1 Recursive Text Segmentation Based on Semantic Boundaries To improve the accuracy and recall of subsequent vector retrieval, this invention employs an adaptive recursive segmentation algorithm to divide long texts into a set of knowledge fragments according to semantic granularity: , Text segmentation employs a rule-based hierarchical recursive strategy, setting a set of delimiter priorities based on the characteristics of the planning document's language: ={paragraph separator, period / question mark / exclamation mark, semicolon, comma} Segmentation follows the principle of recursion from strong semantic boundaries to weak semantic boundaries, when the segment length... Recursive segmentation is triggered on time: L maxS' is the semantically optimal block length (e.g., 500 characters), and S' is the set of secondary delimiters after removing the current delimiter.
[0027] 1.1.2 Semantic Understanding-Based Tag Knowledge Generation This invention introduces a domain-specific large language model to perform semantic tag recognition on each knowledge fragment ci, and automatically extracts and plans knowledge tags: , The semantic tag set is derived from a predefined planning knowledge system, for example: τ∈{land use planning, traffic organization, ecological protection, urban renewal, public service facility layout, ...} The tag generation uses an instruction template-driven intelligent classification model, and the generation method is as follows: , Where P is the classification prompt template. For domain-specific large language models.
[0028] 1.1.3 Semantic Location of PDF Page Numbers To improve the ability to trace the source of answers, this invention implements a page-level content tracking mechanism. When processing PDF documents, the system establishes a mapping relationship between text fragments and page numbers: , Where d j For the file to which it belongs, p k Page number. Text similarity is calculated using a semantic approximation matching algorithm to trace back to the corresponding page: , The similarity function uses a fuzzy matching algorithm: , 1.1.4 Vectorized Knowledge Storage All processed knowledge fragments are encoded into high-dimensional semantic vectors to construct a vector database. , in To plan the embedded model after knowledge fine-tuning.
[0029] Ultimately, this results in structured knowledge entries: , 1.2 Precise Multi-Stage Retrieval Strategy To improve the accuracy and business relevance of semantic retrieval in the planning domain, this invention proposes a multi-stage integrated high-efficiency semantic retrieval strategy. This strategy combines vector semantic retrieval, context expansion, semantic reordering, and keyword enhancement mechanisms to significantly improve the performance of single retrieval methods in long texts and cross-chapter planning semantic association scenarios.
[0030] This method takes a user query Q as input and outputs a set of semantically related knowledge fragments. The overall process is as follows: 1.2.1 Initial Detection of Vector Semantics In the first stage, the query Q is mapped to a vector representation using a text embedding model: , Where E(∙) represents the domain-fine-tuned embedding model. Subsequently, in the knowledge base vector index... Perform a Top-K search to obtain the initial candidate set: , Each candidate fragment The corresponding semantic similarity score is: , This stage quickly identifies a large number of potentially relevant documents, providing a semantic foundation for subsequent fine-grained ranking.
[0031] 1.2.2 Context-Extended Search Enhancement Considering that planning documents are typically stored in segments, a single segment may not fully express the semantics. This invention addresses this by analyzing initial candidate segments. Context expansion is performed, merging each segment with its preceding and following text to generate an expanded segment set. : , The semantic matching score of the extended fragment is updated in conjunction with the context: , This step ensures that the search results are logically consistent in terms of clauses and semantics of chapters, reducing semantic loss caused by segmentation.
[0032] 1.2.3 Semantic Reordering Across Encoders To further improve the sorting performance, this invention introduces a deep Transformer-based approach. Model Rerank, for each candidate extended fragment Refine the results using query Q: , This model captures implicit relationships between long texts through deep semantic matching and contextual interaction, thereby improving the ranking of highly relevant segments in the final results.
[0033] 1.2.4 Keyword Enhancement Filtering To further ensure the business relevance of search results, a keyword coverage mechanism is introduced. The system extracts a set of keywords from query Q. And calculate the keyword coverage rate for each candidate segment: Finally, the scores from each stage are weighted and combined to create the final score for the candidate segments: , Where the weight w j It can be adjusted according to business needs to balance recall and precision.
[0034] 1.2.5 Final Candidate Set Output Based on the final score S i Sort the candidate fragments and output the Top-K knowledge fragment set. : , This multi-stage retrieval strategy effectively improves the accuracy, recall, and business relevance of the retrieval system in the planning domain by integrating vector semantic retrieval, context expansion, deep semantic reordering, and keyword enhancement.
[0035] 1.3 Online Search Module To further expand the sources of knowledge in the planning domain, this invention designs an online retrieval module to acquire real-time, multi-source planning information and transform it into knowledge fragments that can be used for semantic retrieval. This module maintains a consistent vectorized representation and retrieval strategy with the local knowledge base to ensure query consistency and high relevance.
[0036] 1.3.1 Online Document Acquisition and Structure The system receives user query Q and generates a collection of web pages through online retrieval across multiple platforms. Each webpage contains a title, body text, and links: , Search channels include: Government official websites (such as the Ministry of Natural Resources and the Ministry of Housing and Urban-Rural Development) Planning-related professional public account Public search engines (such as Bing) The system cleanses the webpage content, removes redundant information, and uses a recursive semantic segmentation algorithm (same as 3.1.1) to segment the main text into a set of knowledge fragments. : , The Segment(∙) function recursively segments the text according to the planned semantic boundaries, ensuring both segment length and semantic integrity.
[0037] 1.3.2 Vectorized Representation and Multi-Stage Retrieval Each online segment Use an embedding model consistent with the local knowledge base. Convert to vector: , Subsequently, the user query Q is vectorized. Using the same multi-stage efficient semantic retrieval strategy as in 3.2, candidate segments are initially detected, contextualized, subjected to cross-encoder semantic reordering, and enhanced keyword filtering to obtain an online candidate segment set C. web : , This step ensures a high semantic match between online document fragments and queries, while maintaining a consistent scoring standard with vector retrieval results from the local knowledge base.
[0038] 1.4 Automatic Retrieval and Question Answering Intelligent Agent The intelligent agent module enables automatic retrieval decisions, context integration, and natural language question-answering generation for user queries Q. The system uses a large language model to determine the optimal retrieval source and dynamically switches between them to ensure the accuracy and professionalism of the answers.
[0039] 1.4.1 Dynamic selection of search sources The system is designed with a retrieval source selection prompt for the agent. source Input the user's question Q and ask the model to output: Output∈{Local,Web} The output reflects the retrieval source that the agent believes is most likely to provide the answer. The token probabilities output by the large language model can be quantified to indicate trustworthiness. P Local ,P Web =LLM source (Q) The final search source selected is: , 1.4.2 Retrieval and Context Integration Depending on the selected source, the agent retrieves a set of candidate fragments from a local knowledge base or an online retrieval module. The fragment set is then processed as follows: Deduplication: Removing duplicate segments; Concatenate the context: Combine highly relevant segments in logical order to form the model input context: Context=Aggregate(C selected ) This step ensures the semantic integrity and logical coherence of the context, and preserves source information to facilitate answer tracing.
[0040] 1.4.3 Question and Answer Generation and Answer Optimization The agent inputs the context and query Q into the domain-specific large language model to generate the final answer A. A = LLMQA(Q, Context) After generation, the answer is processed as follows: Formatting cleanup: Remove redundant line breaks and correct punctuation; Readability optimization: Maintain clarity and logical integrity; Source attribution: Indicate the source and link of the clip. 1.4.4 Dynamic switching and closed-loop feedback If the initial search results cannot support a valid answer (e.g., the answer contains "cannot answer based on existing information" or insufficient contextual information), the system triggers another search source to re-integrate the context and generate the question and answer: , If neither of the two retrieval sources provides valid information, the agent ultimately returns a standard prompt: "Unable to answer based on existing knowledge." This prompt is added to the incorrect question set for system optimization. This closed-loop mechanism ensures that the agent can dynamically optimize its retrieval strategy in multi-source information scenarios, improving the completeness and reliability of question answering.
[0041] The number of devices and processing scale described herein are for simplification of the invention. Applications, modifications, and variations of this invention will be readily apparent to those skilled in the art. Although embodiments of the invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. It can be applied to various fields suitable for this invention, and further modifications can be readily implemented by those skilled in the art. Therefore, without departing from the general concept defined by the claims and their equivalents, this invention is not limited to the specific details and illustrations shown and described herein.
Claims
1. An intelligent question-answering method for a large language model in the planning domain, characterized in that, include: Build a local knowledge base; Multi-stage semantic retrieval is performed using the local knowledge base; By combining online real-time retrieval with the structured online real-time retrieval data and using unified vector encoding with the local knowledge base; User queries are handled through an intelligent module. Automatic retrieval decision-making, context integration, and natural language question answering generation.
2. The intelligent question-answering method for a large language model in the planning domain as described in claim 1, characterized in that, The construction of the local knowledge base specifically involves: Multi-source document parsing: Receives various document types, including planning reports, policies and regulations, PPT presentations, and web pages, and parses them into standard text. Semantic segmentation and tag generation: Long texts are split into knowledge fragments using a recursive semantic segmentation algorithm, and semantic tags are generated using a domain-specific large language model; Page number location and vectorized storage: Each segment is bound to the original page number and encoded as a high-dimensional vector and stored in a vector database to realize searchable and traceable knowledge entries.
3. The intelligent question-answering method for a large language model in the planning domain as described in claim 1, characterized in that, The multi-stage semantic retrieval using the local knowledge base specifically involves: Vectorized query matching of knowledge base vectors enables rapid filtering of candidate fragments, thereby achieving initial screening; Merge the text before and after the fragment to ensure semantic integrity and achieve contextual expansion; By reordering candidate fragments using Sentence-Transformers and optimizing the ranking based on keyword coverage, a set of highly relevant fragments is output, achieving semantic reordering and keyword enhancement.
4. The intelligent question-answering method for a large language model in the planning domain as described in claim 1, characterized in that, User queries are handled through an intelligent module. The automatic retrieval decision-making, context integration, and natural language question-answering generation are as follows: Search source selection: Determine the optimal data source through a large language model; Context integration: Deduplication and concatenation of candidate fragments in logical order; Answer generation and optimization: Generate well-organized, logically complete answers with source attribution; Closed-loop feedback: If the answers are insufficient, the search source is automatically switched or the question is recorded for knowledge base updates and model optimization.
5. The intelligent question-answering method for a large language model in the planning domain as described in claim 2, characterized in that, The tag generation specifically involves: Each knowledge fragment is analyzed using a domain-specific large language model. Perform semantic tag recognition and automatically extract planning knowledge tags; Tag generation uses an intelligent classification model driven by instruction templates.
6. The intelligent question-answering method for a large language model in the planning domain as described in claim 2, characterized in that, The vectorized storage specifically involves encoding all processed knowledge fragments into high-dimensional semantic vectors, constructing a vector database, and ultimately forming structured knowledge entries.
7. The intelligent question-answering method for a large language model in the planning domain as described in claim 1, characterized in that, The combination of online real-time retrieval and the structured online real-time retrieval data is uniformly vector-encoded with the local knowledge base, specifically as follows: Online document retrieval and structuring: By receiving user queries A collection of web pages is formed through online retrieval on multiple platforms; the web pages are cleaned to remove redundant information, and the main text is divided into a collection of knowledge fragments using a recursive semantic segmentation algorithm. Vectorized Representation and Multi-Stage Retrieval: Each Online Fragment Use an embedding model consistent with the local knowledge base. Convert to a vector; for user queries Vectorization A multi-stage efficient semantic retrieval strategy is used to perform initial screening, context expansion, cross-encoder semantic reordering, and keyword enhancement filtering on candidate segments to obtain an online candidate segment set.
8. The intelligent question-answering method for a large language model in the planning domain as described in claim 4, characterized in that, The selection of the search source specifically involves: selecting Prompt through the search source. source Enter user questions The model is required to output a result that reflects the retrieval source that the agent believes is most likely to provide the answer. The retrieval and context integration specifically involves: based on the selected source, the agent obtains a set of candidate fragments from a local knowledge base or an online retrieval module, and performs deduplication and context splicing on the fragment set.