Construction method and system of intelligent question-answering system based on planning knowledge graph database
By building an intelligent question-answering system based on a planning knowledge graph library, the problems of insufficient data integration and knowledge accumulation in traditional spatial planning are solved, and efficient intelligent question-answering and planning knowledge services are achieved.
Patent Information
- Application Number
- CN202510540989.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-09-19
AI Technical Summary
Traditional spatial planning models rely on manual experience and have difficulty integrating multi-source data, resulting in insufficient knowledge accumulation, low efficiency, and insufficient data utilization, making it difficult to cope with complex planning knowledge questions and answers.
Build an intelligent question-answering system based on a planning knowledge graph library, acquire multi-source data in real time, perform vector embedding and conflict detection, fuse multimodal encoders to vectorize data, use natural language processing to build a knowledge graph, and train the Transformer model for intelligent question-answering.
It achieves efficient accumulation of spatial planning knowledge and intelligent question-and-answer services, reduces reliance on manual experience, improves planning work efficiency, and provides high-quality planning knowledge question-and-answer services.
Smart Images

Figure CN120670543A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of spatial planning and artificial intelligence technology, and specifically relates to a method and system for constructing an intelligent question-answering system based on a planning knowledge graph. In particular, it relates to a method and system for constructing a planning knowledge graph based on multimodal data fusion and dynamic conflict resolution. Background Art
[0002] With the national restructuring of its spatial planning system, new spatial planning faces numerous challenges. Traditional planning models no longer meet the demands of the new development landscape. Currently, there are numerous types of spatial planning, including major functional area planning, national land planning, land use planning, urban and rural planning, and marine functional area planning. Furthermore, there are numerous specialized plans involving spatial utilization, such as transportation planning, water conservancy planning, and river basin planning. Traditional methods, which rely on manual experience and extensive document review, are unable to cope with the increasingly complex planning tasks.
[0003] Since spatial planning involves the integration and analysis of multi-source data, including geographic information, policies and regulations, planning cases, etc., the workload of data processing is large.
[0004] Traditional spatial planning models rely heavily on manual effort, with a significant amount of planning knowledge accumulated through oral or empirical means, making it difficult to effectively consolidate and iterate planning knowledge. Planning knowledge from different years and versions varies in terms of timeliness and specificity, making it difficult to manually identify applicable regulations and rules across different versions of policies and regulations.
[0005] Spatial planning involves a wide range of disciplines and interdisciplinary expertise. It's difficult for a single spatial planner to fully grasp all planning knowledge, often requiring communication and consultation across multiple professional teams, significantly impacting work efficiency. Single retrieval-enhanced generation techniques or knowledge-enhanced generation are unable to address the complexities of planning knowledge systems.
[0006] Spatial planning data and related documents carry certain confidentiality risks, making it difficult for spatial planners to use internet search engines to search for relevant information. Local data and documents are also stored in a decentralized manner, lacking effective query paths, resulting in inadequate utilization of existing data. Manually organizing and integrating vast amounts of planning knowledge and effectively utilizing it is also a difficult task. Currently, large AI models on the market rely on iterative learning from data resources available on the internet, lacking relevant spatial planning knowledge and making them difficult to directly apply to the field. Summary of the Invention
[0007] In order to solve the problems raised by the background technology, the first aspect of the present invention provides a method for constructing an intelligent question-answering system based on a planning knowledge graph library, including: acquiring multi-source spatial planning data in real time; fusing the planning data through vector embedding conflict detection and knowledge fusion methods; vectorizing the fused planning data through a multimodal encoder; based on the vectorized planning data, constructing a knowledge graph accessible to multiple preset retrieval enhancement models through natural language processing methods and message queues; training a Transformer-based pre-trained model through the knowledge graph; in response to user questions, selecting one or more retrieval enhancement models through dynamic routing to retrieve entities and relationships in the knowledge graph; and generating question results through the pre-trained model based on the retrieved entities and relationships.
[0008] In some embodiments of the present invention, the conflict detection and knowledge fusion method of vector embedding is used to fuse the planning data, including: calculating the similarity of entities and relationships through a vector embedding model, detecting conflicting or inconsistent data in the planning data and determining the conflict classification; fusing the conflicting planning data through multiple knowledge fusion methods, and the knowledge fusion methods include priority strategies based on authority and timeliness, consensus voting strategies, merging strategies, and splitting strategies.
[0009] Furthermore, the conflict classification includes entity type conflict, attribute conflict, relationship conflict and time conflict.
[0010] In some embodiments of the present invention, the construction of a knowledge graph accessible to multiple preset retrieval enhancement models based on the vectorized planning data through natural language processing and message queues includes: extracting entities and relationships from the vectorized planning data through natural language processing methods to construct an ontology model; creating a unique identifier for each entity and constructing an index of text fragments corresponding to each entity; establishing a knowledge graph based on multiple entities and indexes through a storage engine; and the knowledge graph is accessed by multiple preset retrieval enhancement models through a message queue.
[0011] In some embodiments of the present invention, in response to user questions, one or more retrieval enhancement models are selected through dynamic routing, and retrieving entities and relationships in the knowledge graph includes: determining the serial and parallel nature of the retrieval enhancement model; determining the existence, relationship complexity and reasoning requirements of the entity in the user question; based on the existence, relationship complexity and reasoning requirements of the entity, one or more modularized retrieval enhancement models are selected, and retrieving entities and relationships in the knowledge graph through serial and parallel nature.
[0012] Furthermore, the selection of one or more modularized retrieval enhancement models based on the existence of the entity, the complexity of the relationship and the reasoning requirements includes: if there is no entity in the question, selecting the retrieval enhancement generation model; otherwise, according to the complexity of the relationship, selecting the retrieval enhancement generation model, the knowledge enhancement generation model or the graph knowledge enhancement generation model; if reasoning is required in the question, selecting the knowledge enhancement generation model and the graph knowledge enhancement generation model.
[0013] The second aspect of the present invention provides an intelligent question-answering system based on the planning knowledge graph library provided in the first aspect, including: an acquisition module for acquiring multi-source spatial planning data in real time; fusing the planning data through vector embedding conflict detection and knowledge fusion methods; a vectorization module for vectorizing the fused planning data through a multimodal encoder; a construction module for constructing a knowledge graph accessible to multiple preset retrieval enhancement models based on the vectorized planning data through natural language processing methods and message queues; a training module for training a Transformer-based pre-trained model through the knowledge graph; a generation module for responding to user questions, selecting one or more retrieval enhancement models through dynamic routing, and retrieving entities and relationships in the knowledge graph; and generating question results through the pre-trained model based on the retrieved entities and relationships.
[0014] The third aspect of the present invention provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the intelligent question-answering method based on the planning knowledge graph library provided in the first aspect of the present invention.
[0015] A fourth aspect of the present invention provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the intelligent question-answering method based on a planning knowledge graph library provided in the first aspect of the present invention is implemented.
[0016] The beneficial effects of the present invention are: This invention leverages artificial intelligence technologies such as natural language processing, knowledge graph construction, and model training to build a highly efficient and intelligent planning assistant in the field of spatial planning. This effectively consolidates spatial planning knowledge, reduces reliance on manual experience, and assists spatial planners in improving their work efficiency. This invention can also provide planning consultants with high-quality planning knowledge Q&A based on planning regulations, policies, and case studies, enabling knowledge integration and intelligent Q&A in the planning field. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1A schematic diagram of a basic flow chart of a method for constructing an intelligent question-answering system based on a planning knowledge graph library in some embodiments of the present invention; Figure 2 A schematic diagram of the principles of a method for constructing an intelligent question-answering system based on a planning knowledge graph library in some embodiments of the present invention; Figure 3 Schematic diagram of the structure of an intelligent question-answering system based on a planning knowledge graph library in some embodiments of the present invention; Figure 4 Schematic diagram of the structure of an electronic device in some embodiments of the present invention. DETAILED DESCRIPTION
[0018] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0019] Example 1 refer to Figure 1 and Figure 2 In the first aspect of the present invention, a method for constructing an intelligent question-answering system based on a planning knowledge graph library is provided, including: S100. acquiring multi-source spatial planning data in real time; fusing the planning data through conflict detection and knowledge fusion methods of vector embedding; S200. vectorizing the fused planning data through a multimodal encoder; S300. constructing a knowledge graph accessible to multiple preset retrieval enhancement models based on the vectorized planning data through natural language processing methods and message queues; S400. training a Transformer-based pre-trained model through the knowledge graph; S500. selecting one or more retrieval enhancement models through dynamic routing in response to user questions, and retrieving entities and relationships in the knowledge graph; and generating question results through the pre-trained model based on the retrieved entities and relationships.
[0020] It should be noted that a knowledge graph is a structured data model used to represent and organize knowledge. It usually includes but is not limited to the following parts: 1. Entities: Entities are the basic units in a knowledge graph, representing specific things or concepts in the real world. They can be people, places, organizations, events, objects, etc.
[0021] 2. Relationships: Relationships are used to describe the associations between entities. Through relationships, knowledge graphs can express the semantic connections between entities.
[0022] 3. Attributes Attributes are the characteristics or descriptive information of an entity, which are used to further enrich the semantic information of the entity.
[0023] 4. Categories (Types / Classes) Categories are labels used to classify entities, which help organize and manage entities in the knowledge graph.
[0024] 5. Graph Structure: This consists of nodes (entities) and edges (relationships). Nodes represent entities, edges represent relationships between entities, and attributes are attached to nodes or edges.
[0025] In step S100 of some embodiments of the present invention, multi-source spatial planning data is acquired in real time. Specifically, spatial planning-related data is continuously accessed from multiple authoritative data sources, including but not limited to geographic information system (GIS) data, satellite imagery, planning documents, standards and specifications, policy and regulatory documents, and historical planning case data. After data is sorted and cleaned, a local database is established to store sensitive information and classified data. Data interfaces are established with geographic information departments, planning management departments, government regulatory databases, and other organizations to continuously acquire the latest spatial planning data, including high-precision GIS data, the latest satellite imagery, updated planning documents, and policy and regulatory documents.
[0026] Collected data is cleaned, organized, and standardized to ensure accuracy, consistency, and completeness. For example, this involves unifying geographic coordinate systems, standardizing planning terminology, and converting document data into structured formats for subsequent analysis and processing. Data cleaning and conversion tools are used to pre-process data from various formats and sources. For example, topology checks and error correction are performed on GIS data; for planning documents, text parsing techniques are used to extract key information and convert it into structured data; and for policy and regulatory documents, clauses are categorized and keyword-annotated by time version.
[0027] Establish a data association mechanism to associate and integrate different types of data according to dimensions such as geographic spatial location, planning elements, and time series, forming an organic whole of multi-source heterogeneous data and providing comprehensive data support for intelligent assistants.
[0028] In step S100, the conflict detection and knowledge fusion method of vector embedding is used to fuse the planning data, including: calculating the similarity of entities and relationships through a vector embedding model, detecting conflicting or inconsistent data in the planning data and determining conflict classification; fusing the conflicting planning data through multiple knowledge fusion methods, and the knowledge fusion methods include priority strategies based on authority and timeliness, consensus voting strategies, merging strategies, and splitting strategies.
[0029] Specifically, identify conflicting or inconsistent information between data from different sources in the knowledge graph.
[0030] By defining a set of rules to check the logical relationship between entities and their attributes, using vector embedding models to calculate the similarity of entities and relationships, identifying potential conflicts, and for data with a time dimension, checking whether there are overlaps or conflicts in time intervals. The detected conflicts are classified so that appropriate resolution strategies can be adopted. They are divided into type conflicts: different sources have inconsistent type definitions for the same entity. For example, a policy is labeled "short-term" in one document and "long-term" in another document. Value conflicts: The values of the same attribute in different sources are inconsistent. Relationship conflicts: The relationships between entities are different in different sources. For example, policy A is considered a prerequisite for policy B in one document, but not in another document. Time conflicts: Conflicts involving the time dimension, such as the chronological order of events or overlapping validity periods.
[0031] Conflict resolution strategies include prioritization, including authority and timeliness. Consensus strategies include majority voting, where multiple sources provide the same entity or relationship, and a majority vote to determine the final outcome. Expert review involves manual review and judgment by domain experts, particularly when complex logic or high-risk decisions are involved.
[0032] Fusion strategies include merging different types of data into a more comprehensive picture, and splitting strategies: If a conflict cannot be resolved through merging, the conflicting parts can be split into independent sub-entities or relationships and handled separately. Historical records and version control: All conflict resolution records are retained for easy traceability and auditing. The reasons and basis for each conflict resolution, as well as the final adopted outcome, are recorded.
[0033] Refer to the table below:
[0034] It is understandable that a conflict resolution mechanism is established to handle conflicts in the data fusion process. Conflicting knowledge is fused through conflict detection mechanisms and resolution strategies.
[0035] In step S200 of some embodiments of the present invention, the fused planning data is vectorized by a multimodal encoder; Specifically, a unified data representation framework is established to convert all types of information (text, graph structures, knowledge graphs, etc.) into a unified vector form, allowing them to be processed within the same model. A combination of spatial database management systems (such as PostGIS) and relational database management systems (such as PostgreSQL) is used to store the integrated data. Unique codes are established for each geographic entity, along with data indexes and associated tables, to ensure efficient data retrieval and relational queries.
[0036] It is understandable that establishing a unified data representation framework converts all types of information (text, graph structures, knowledge graphs, etc.) into a unified vector form, allowing them to be processed within the same model. Establishing mutual indexes between text blocks and graph structures facilitates subsequent queries, allowing for both detailed background information and understanding the logical connections between them. A multimodal encoder is introduced to support both text input and graph input, mapping them into the same vector space. For example, the text encoder converts entities such as "Chaoyang District, Beijing" and "park construction" into vector representations, while the graph encoder converts relevant policies and planning objectives related to "Chaoyang District, Beijing" into node embedding vectors, which are then sent to the KAG, RAG, and Graph RAG modules via a message queue.
[0037] In step S300 of some embodiments of the present invention, constructing a plurality of knowledge graphs accessible to preset search enhancement models based on the vectorized planning data through natural language processing and message queues includes: S301. Extract entities and relationships from the vectorized planning data through natural language processing methods to construct an ontology model; Specifically, natural language processing tools (such as Stanford NLP and NLTK) are used to perform lexical and syntactic analysis on planning documents and policy and regulatory documents, extracting entities and relationships. Integrating domain expert knowledge, entity types, relationship types, and attribute lists are defined to construct an ontology model. Within the knowledge graph, a unique identifier is created for each entity and indexed with the corresponding text fragment.
[0038] S302. Create a unique identifier for each entity and build an index of the text fragments corresponding to each entity. After establishing the unique entity code, set up a cross-index between the text blocks and the graph structure, so that subsequent queries can obtain detailed background information and understand the logical connections between them. This indexing mechanism also enables different modules to access and use the same results.
[0039] S303. Based on multiple entities and indexes, a knowledge graph is established through a storage engine; the knowledge graph is accessed by multiple preset retrieval enhancement models through a message queue.
[0040] Specifically, create an index for each text entity and record its corresponding graph structure node. Create an index for each graph structure node and record its corresponding text description. When new text or graph structure data is generated, update the corresponding index. You can choose Elasticsearch as the text index storage engine and Neo4j as the graph database storage engine. Store the constructed knowledge graph in a graph database (such as Neo4j), and use the graph database's query language (such as Cypher) to query, update, and expand the knowledge graph. Update the knowledge graph regularly to incorporate new data and knowledge into it to maintain its timeliness. Use asynchronous message queues (such as RabbitMQ, Kafka) to handle communication between modules to improve the system's response speed and throughput. For frequently accessed data, you can use a cache (such as Redis) to reduce repeated calculations and improve performance.
[0041] When answering user questions, we first use NLP technology to parse the user's query, determine their intent, and the type of knowledge required. Simple factual questions can be directly handled by the RAG module; complex reasoning questions are then passed to the KAG or Graph RAG modules.
[0042] For the RAG+KAG combination, a preliminary vector similarity search is performed first, and then the mutual indexing mechanism in KAG is used to further filter out the most relevant information blocks; for the RAG+Graph RAG combination, the graph-based retrieval method is given priority to find a set of nodes with strong correlation.
[0043] A modular framework design is employed for technology integration. Each technology (KAG, RAG, and Graph RAG) is treated as an independent functional module, which can be configured and optimized independently. The collaboration model between modules can be dynamically adjusted based on the needs of specific application scenarios. An intermediary layer is introduced to manage communication and data flow between different modules, ensuring data connectivity between KAG, RAG, and Graph RAG models.
[0044] It's important to note that a multimodal encoder is designed for data planning, converting different types of input (text, graph structures, etc.) into a unified vector representation so that they can be processed within the same model. This includes a text encoder, a graph encoder, and a feature fusion layer, which receives the outputs from different encoding modules and maps them into the same vector space for answer generation.
[0045] Using KAG, RAG, and Graph RAG techniques, we extract entities, relationships, and attributes in the spatial planning field from the integrated data and construct a spatial planning knowledge graph. In the knowledge graph, we create a unique identifier for each entity and establish an index relationship between it and the corresponding text fragment.
[0046] Entities include geographic entities (such as cities, regions, mountains, and rivers), planning entities (such as land use types, functional zoning, and infrastructure), policy and regulatory entities (such as regulatory names, clause content, and scope of application), and related institutional and personnel entities. A cross-indexing mechanism between text blocks and graph structures is established to facilitate subsequent queries, providing both detailed background information and understanding the logical connections between them.
[0047] The relationships include spatial relationships (such as adjacency, inclusion, intersection, etc.), planning logic relationships (such as the relationship between planning objectives and measures, the coordination of land use and transportation planning, etc.), legal constraints (such as legal restrictions on land use, requirements for construction projects, etc.) and time series relationships (such as the historical evolution of planning, the implementation progress of the project, etc.).
[0048] By continuously updating and expanding the knowledge graph, its timeliness and integrity are maintained to adapt to the dynamic changes in the field of spatial planning.
[0049] Establishing an efficient search engine based on the data mutual indexing mechanism and entity unique coding constructed above can achieve efficient information retrieval based on vector similarity and ensure the rapid location of relevant knowledge fragments.
[0050] In step S400 of some embodiments of the present invention, a Transformer-based pre-training model is trained using the knowledge graph; Specifically, based on the characteristics of the spatial planning task, appropriate deep learning frameworks (such as TensorFlow and PyTorch) are selected to build the model. For example, for geospatial image analysis, a CNN-based model architecture is constructed, adjusting the parameters of the convolutional, pooling, and fully connected layers. For natural language processing tasks, pre-trained Transformer-based models (such as BERT and GPT) are selected. Based on modularization and the introduction of intermediate layers, a joint training strategy is employed for model training. During training, different modules share some parameters to promote information exchange and collaborative learning.
[0051] Collect a large amount of historical planning case data, perform data annotation and preprocessing, and divide it into training, validation, and test sets. Use the training set to train the model. During training, monitor the model's loss function and evaluation metrics (such as accuracy, recall, and F1 value), and fine-tune the optimization algorithm parameters and learning rate strategy based on changes in these metrics.
[0052] Verify and test the trained model, use the validation set to evaluate the generalization ability of the model, analyze the performance of the model based on the results of the test set, and further optimize and adjust the model to ensure the accuracy and reliability of the model in practical applications.
[0053] Based on continuously accessed planning knowledge and policies, we continuously update training database samples, the knowledge base, and the knowledge graph. We also use incremental knowledge to continuously update training results, ensuring the model remains up-to-date. At the same time, we continuously adjust and optimize the system's decision-making process based on user feedback.
[0054] It can be understood that based on the modularization of multiple retrieval enhancement models, it is necessary to design a dynamic routing mechanism to select retrieval models, semantically parse user questions, and extract key features (such as entities, relationships, and question types).
[0055] In step S500 of some embodiments of the present invention, in response to a user question, selecting one or more retrieval enhancement models through dynamic routing to retrieve entities and relationships in the knowledge graph includes: S501. Determine the serial and parallel retrieval enhancement model; Specifically, it is divided into parallel mode and serial mode. In parallel mode, multiple modules process questions simultaneously and generate the final answer through voting or weighted fusion. In serial mode, RAG is first called to retrieve documents. After obtaining entities, the corresponding graph structure information is clarified through cross-indexing retrieval. Finally, KAG / Graph RAG is used for reasoning enhancement.
[0056] S502. Determine the existence, relationship complexity, and reasoning requirements of entities in the user's question; S503. Based on the existence of the entities, the complexity of the relationships and the reasoning requirements, one or more modularized retrieval enhancement models are selected to retrieve entities and relationships in the knowledge graph in serial and parallel manner.
[0057] Furthermore, the selection of one or more modularized retrieval enhancement models based on the existence of the entity, the complexity of the relationship and the reasoning requirements includes: if there is no entity in the question, selecting the retrieval enhancement generation model; otherwise, according to the complexity of the relationship, selecting the retrieval enhancement generation model, the knowledge enhancement generation model or the graph knowledge enhancement generation model; if reasoning is required in the question, selecting the knowledge enhancement generation model and the graph knowledge enhancement generation model.
[0058] Specifically, refer to the following table for routing judgment:
[0059] Furthermore, as users engage in Q&A, the system collects user data to build and continuously update user profiles. It uses clustering and classification algorithms to model user behavior, identify different user groups, and optimize service strategies accordingly. Contextual awareness considers the context of the conversation (such as time, location, and device type) to more accurately portray the user's current state and needs.
[0060] Through user portraits, we can classify user groups and provide language answers that are suitable for their understanding based on the professionalism of different groups. At the same time, we can accurately locate the most suitable planning knowledge based on the field of user consultation questions and provide high-quality answers.
[0061] A question classification model is established to categorize user-entered questions and determine the question type (e.g., policy and regulation consultation, planning solution query, technical question answering, etc.). Based on the question type, relevant entities and relationships are retrieved from the knowledge graph, and the model is used to generate answers. Answers are post-processed, such as language polishing and formatting adjustments, to make them more consistent with user reading habits.
[0062] S504. Based on the retrieved entities and relationships, generate question results through the pre-trained model.
[0063] The answer to the question is generated by the multimodal result fusion layer, which combines multi-dimensional information such as text, graphs, and geographic space, and automatically selects the RAG / KAG / Graph RAG combination according to the complexity of the question.
[0064] When multiple information sources are selected, a strategy is needed to integrate them. This can be achieved through the knowledge alignment feature in KAG, which aligns knowledge fragments from different sources to eliminate redundancy and maintain consistency. Furthermore, the community detection algorithm in Graph RAG can be used to organize scattered knowledge points into a coherent whole. Alternatively, weighted scoring fusion or generative fusion methods can be used for fusion.
[0065] Generate a final answer based on the retrieved information. Leverage all previous work, including but not limited to background information provided by the knowledge graph and intermediate results generated during the reasoning process. Additionally, set rules to ensure that the generated answer meets the requirements of a specific domain.
[0066] To assist with planning scheme generation, a user input interface is designed to guide users in entering information such as planning objectives, geographical conditions, and constraints. This input is combined with the knowledge graph and model, leveraging the predictive capabilities of a rule-based inference engine and deep learning models to generate preliminary planning schemes. Optimization algorithms such as genetic algorithms and simulated annealing are used to optimize the generated schemes and improve their quality.
[0067] When developing planning data visualization capabilities, select appropriate visualization libraries (such as Echarts and D3.js) and design a variety of visualization templates based on data types and user needs, such as maps to visualize land use distribution, bar charts to compare planning indicators, and 3D models to display urban spatial forms. Implement user interaction features, allowing users to explore and analyze data through operations such as mouse clicks and drags.
[0068] When implementing the planning scheme evaluation function, a multi-index evaluation system is established, with the weights and calculation methods for the evaluation indicators determined. Planning scheme data is input into the evaluation model, and scores for each indicator are calculated to comprehensively evaluate the scheme's strengths and weaknesses. Based on the evaluation results, an evaluation report is generated, providing users with detailed analysis and improvement suggestions.
[0069] Example 2 refer to Figure 3 According to the second aspect of the present invention, an intelligent question-answering system 1 based on a planning knowledge graph library is provided, comprising: an acquisition module 11 for acquiring multi-source spatial planning data in real time; fusing the planning data through conflict detection and knowledge fusion methods of vector embedding; a vectorization module 12 for vectorizing the fused planning data through a multimodal encoder; a construction module 13 for constructing a knowledge graph accessible to multiple preset retrieval enhancement models based on the vectorized planning data through natural language processing methods and message queues; a training module 14 for training a Transformer-based pre-trained model through the knowledge graph; a generation module 15 for retrieving entities and relationships in the knowledge graph by selecting one or more retrieval enhancement models through dynamic routing in response to user questions; and generating question results through the pre-trained model based on the retrieved entities and relationships.
[0070] Furthermore, the acquisition module 11 includes: a detection unit, which is used to calculate the similarity of entities and relationships through a vector embedding model, detect conflicting or inconsistent data in the planning data, and determine the conflict classification; a fusion unit, which is used to fuse the conflicting planning data through multiple knowledge fusion methods, and the knowledge fusion methods include priority strategies based on authority and timeliness, consensus voting strategies, merging strategies, and splitting strategies.
[0071] Example 3 refer to Figure 4 In the third aspect of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method for constructing an intelligent question-answering system based on a planning knowledge graph library in the first aspect of the present invention.
[0072] The electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the electronic device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0073] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0074] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wire, optical cable, RF (radio frequency), etc., or any suitable combination thereof.
[0075] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more computer programs, which, when executed by the electronic device, cause the electronic device to: Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, Python, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing an intelligent question-answering system based on a planning knowledge graph library, characterized in that: include: Real-time acquisition of multi-source spatial planning data; fusing the planning data through conflict detection and knowledge fusion methods based on vector embedding; Vectorize the fused planning data through a multimodal encoder; Based on the vectorized planning data, we build a knowledge graph accessible to multiple preset search enhancement models through natural language processing methods and message queues. Using the knowledge graph, train a Transformer-based pre-training model; In response to a user's question, one or more retrieval enhancement models are selected through dynamic routing to retrieve entities and relationships in the knowledge graph; based on the retrieved entities and relationships, question results are generated through a pre-trained model.
2. The method for constructing an intelligent question-answering system based on a planning knowledge graph library according to claim 1, characterized in that: The conflict detection and knowledge fusion method of vector embedding to fuse the planning data includes: By using a vector embedding model, the similarity between entities and relationships is calculated to detect conflicting or inconsistent data in planning data and determine conflict classifications. The conflicting planning data are fused through multiple knowledge fusion methods, including a priority strategy based on authority and timeliness, a consensus voting strategy, a merging strategy, and a splitting strategy.
3. The method for constructing an intelligent question-answering system based on a planning knowledge graph library according to claim 2, characterized in that: The conflict classification includes entity type conflict, attribute conflict, relationship conflict and time conflict.
4. The method for constructing an intelligent question-answering system based on a planning knowledge graph library according to claim 1, characterized in that: The knowledge graphs accessible to multiple preset search enhancement models are constructed based on the vectorized planning data through natural language processing and message queues, including: Extract entities and relationships from vectorized planning data through natural language processing methods to build an ontology model; Create a unique identifier for each entity and build an index of the text fragments corresponding to each entity; Based on multiple entities and indexes, a knowledge graph is built through a storage engine; The knowledge graph is accessed by multiple preset retrieval enhancement models through a message queue.
5. The method for constructing an intelligent question-answering system based on a planning knowledge graph library according to claim 1, characterized in that: In response to the user's question, selecting one or more retrieval enhancement models through dynamic routing to retrieve entities and relationships in the knowledge graph includes: Determine serial and parallel retrieval enhancement models; Determine the existence, relationship complexity, and reasoning requirements of entities in user questions; Based on the existence of the entities, the complexity of the relationships, and the reasoning requirements, one or more modularized retrieval enhancement models are selected to retrieve entities and relationships in the knowledge graph in serial and parallel manner.
6. The method for constructing an intelligent question-answering system based on a planning knowledge graph library according to claim 5, characterized in that: The selecting of one or more modularized retrieval enhancement models based on the entity existence, relationship complexity, and reasoning requirements includes: If no entity exists in the question, the retrieval-enhanced generative model is selected; otherwise, the retrieval-enhanced generative model, the knowledge-enhanced generative model, or the graph-knowledge-enhanced generative model is selected based on the complexity of the relationship. If reasoning is required in the question, choose the knowledge-enhanced generation model and the graph-knowledge-enhanced generation model.
7. An intelligent question-answering system based on a planning knowledge graph library, characterized in that: include: Acquisition module, used to obtain multi-source spatial planning data in real time; fusing the planning data through conflict detection and knowledge fusion methods based on vector embedding; A vectorization module, used to vectorize the fused planning data through a multimodal encoder; A construction module for constructing a knowledge graph accessible to multiple preset retrieval enhancement models based on vectorized planning data through natural language processing methods and message queues; A training module, used to train a Transformer-based pre-training model using the knowledge graph; The generation module is used to respond to user questions, select one or more retrieval enhancement models through dynamic routing, retrieve entities and relationships in the knowledge graph; and generate question results through a pre-trained model based on the retrieved entities and relationships.
8. The intelligent question-answering system based on the planning knowledge graph library according to claim 7 is characterized in that: The acquisition module includes: A detection unit, configured to calculate the similarity of entities and relationships through a vector embedding model, detect conflicting or inconsistent data in the planning data, and determine conflict classification; The fusion unit is used to fuse conflicting planning data through multiple knowledge fusion methods, wherein the knowledge fusion methods include a priority strategy based on authority and timeliness, a consensus voting strategy, a merging strategy, and a splitting strategy.
9. An electronic device comprising: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for constructing an intelligent question-answering system based on a planning knowledge graph library as described in any one of claims 1 to 6.
10. A computer-readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, it implements the method for constructing an intelligent question-answering system based on a planning knowledge graph library as described in any one of claims 1 to 6.
Citation Information
Cited By
Cross-modal agent base deployment system and method based on AI large model
CN121052282A
An AI large model-based cross-modal agent base deployment system and method
CN121052282B
Information retrieval method and device based on multi-modal knowledge graph
CN121327148A
Knowledge graph construction method, device and system based on large model
CN121436141A
Safety supervision work ticket intelligent generation method based on ReAct intelligent agent
CN121503703A