National region traditional settlement and building knowledge base construction method based on large language model and knowledge graph technology and question answering system
By using large language models and knowledge graph technology, a knowledge base for traditional settlements and architecture in ethnic minority areas is constructed. This solves the problems of one-sidedness and redundancy in existing knowledge bases, and achieves highly accurate knowledge query and reasoning capabilities, making it suitable for research on traditional settlements and architecture in ethnic minority areas.
Patent Information
- Application Number
- CN202511509784.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2025-11-21
AI Technical Summary
Existing knowledge bases in the field of traditional settlements and architecture in ethnic minority areas suffer from problems such as one-sided answers, redundant knowledge points, and inability to describe the relationships between multi-layered things.
By employing large language models and knowledge graph technology, field survey data and literature collection data are transformed into semantic ontology data, imported into the neo4j graph database, and a query module is built using the GraphRAG module and the LangChain development framework to achieve automatic identification and reasoning of entities and relationships.
It enables comprehensive querying and highly accurate answers to the knowledge base of traditional settlements and architecture in ethnic minority areas, possesses analytical and reasoning capabilities, comprehensively processes structured and unstructured data, and provides logical and academic feedback.
Smart Images

Figure CN120996174A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, specifically to a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, and a question-answering system. Background Technology
[0002] In the field of artificial intelligence, knowledge bases can compensate for the shortcomings of general-purpose large language models, such as insufficient knowledge in specialized fields, untimely updates, and a lack of dedicated data. Furthermore, they offer low construction costs, fast query speeds, and high-quality answers. As research and application of artificial intelligence in the vertical field of architecture deepens, there have been numerous attempts in architectural design, such as architectural engineering knowledge bases and building code knowledge bases. However, there is still a lack of professional knowledge bases and knowledge-based question-and-answer systems specifically for traditional settlements and architecture in ethnic minority areas.
[0003] However, most existing knowledge bases primarily utilize traditional keyword fuzzy matching query techniques. These solutions focus on fragmented textual snippets and scattered data stored in databases, failing to summarize and generalize knowledge from a holistic perspective, let alone provide reasoning capabilities. But the fields of traditional culture and architecture encompass a vast array of things that are not isolated but interconnected through complex relationships. Therefore, traditional knowledge bases often suffer from one-sided answers, redundant knowledge points, and an inability to describe the relationships between multiple layers of things. Summary of the Invention
[0004] The purpose of this application is to provide a method and question-answering system for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, in order to solve the problems that existing knowledge bases often have one-sided answers, redundant knowledge points, and are unable to describe the relationships between multi-level things.
[0005] To achieve the above objectives, this application provides a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, including the following steps: converting architectural survey data from field survey data into semantic ontology data, wherein the semantic ontology data structure is consistent with entity tables and relation tables, and then directly importing it into the neo4j graph database through a script; The field survey data and other structured data from the literature collection data are split into multiple entity tables and relation tables according to the data content, and then directly imported into the neo4j graph database through a script; Unstructured data from field surveys and literature collections are saved in .txt text format, and then processed by combining a large language model with the GraphRAG module framework to finally generate data in the neo4j graph database. Extract the entity types stored in the neo4j graph database, export them as an entity type table, and create AI suggestion words for entity type word segmentation; The query module of the large language model is built through the LangChain development framework module. The user input question string and AI prompt words are sorted out as the first input item, and the query statement in the neo4j graph database is answered by the large language model as the first output item. Use the generated query statement as the second input to query the neo4j graph database, and use the query result as the second output. The second output item is the descriptive data of entities and relationships. The second output item is used as the third input item and is refined by a large language model to be transformed into natural language and conventional data structure output as the third output item.
[0006] Optionally, after outputting the third output item, the method further includes: The third output result data is processed and rendered as text paragraphs and table content on the page.
[0007] To achieve the above objectives, this application also provides a question-and-answer system based on a knowledge base of traditional settlements and architecture in ethnic minority areas, using large language models and knowledge graph technology. The system includes a knowledge base comprising a large language model, a front-end, and a back-end, wherein: The large language model implements knowledge question answering functionality through API. In the data processing stage, the large language model processes and analyzes unstructured data to generate corresponding entity and relation data, which are then stored in a graph database to construct a complete knowledge graph. In the knowledge question answering stage, the large language model breaks down the question and generates query statements for the graph database. The retrieved results from the knowledge base are then reassembled into logical and academic natural language feedback for the user. The backend includes a GraphRAG module, a general function module, a LangChain development framework module, and a REST API interface. The GraphRAG module is used to analyze, transform, and store the raw data required to build the knowledge base. The general function module includes a Neo4j graph database, which provides storage, query, and analysis functions for the knowledge base. The LangChain development framework module provides users with the ability to interact with the underlying system. The REST API interface is provided for the frontend to call. The front end includes a system entry point, functional pages, and a front end underlying framework. The front end is used to call the back end's REST API interface. The underlying framework integrates various contents and encapsulates various business components. Multiple business components are combined to form individual pages, and multiple pages together constitute the entire functional page.
[0008] Optionally, the large language model includes a commercial large language model and an open-source large language model. The commercial large language model implements the knowledge question-answering function by calling the official API, while the open-source large language model implements the question-answering function through the general API provided by the large language model management tool Ollama.
[0009] Optionally, the general function module also includes basic functions such as user permission system management, file management, and data management.
[0010] Optionally, the LangChain development framework module includes a standardized method for calling the large language model API.
[0011] Optionally, the knowledge base is constructed using a knowledge graph technology solution, which is logically divided into a schema layer and a data layer. The schema layer is built on top of the data layer, and an ontology library is used to manage the schema layer of the knowledge graph. The data layer consists of a series of facts, and knowledge is stored in units of facts.
[0012] Optionally, the technical architecture of the knowledge graph includes information extraction, knowledge fusion, and knowledge processing.
[0013] The embodiments of this application have the following advantages: Using the methods or systems described above: (1) The first dedicated knowledge base for the study of traditional settlements and architecture in ethnic minority areas based on large language model and knowledge graph technology has been realized: the knowledge base in the vertical field of architecture includes categories such as building engineering and building codes. Common data sources include professional code data, design documents of various professions, engineering-related books, engineering-related research papers, project feasibility study reports, and reports from experts in the field of architecture. However, it lacks historical research books and papers on existing settlements and architecture in ethnic minority areas, basic survey data sets, survey reports, on-site survey drawings, and other data.
[0014] (2) In terms of database type selection, graph databases provide more comprehensive query results than traditional databases. In field surveys, semantic ontology is used to decompose settlements and building entities into different entities and relationships. The semantic ontology method is upgraded to knowledge graphs, and the relationship between entities is upgraded from a tree structure to a network structure. The mutual association between entities is more comprehensive, thus having analytical and reasoning capabilities. Therefore, choosing a graph database based on knowledge graphs can query all entities associated with a single entity and has analytical and reasoning capabilities, thus achieving higher accuracy and more complete answers than previous queries.
[0015] (3) In the data collection stage, the knowledge base based on the big language model can integrate structured and unstructured data. It can transform the content of field interviews, historical documents and other content into structured data through the big language model, realize the automatic identification of the relationship between entities, and thus achieve automatic analysis and reasoning of graph database. The modeling method of semantic ontology is introduced to provide a theoretical basis for entity division in knowledge graph. The building is decomposed into components such as roof tiles and wooden beams and columns, and the relationship between different entities is sorted out to construct a knowledge graph of building elements based on semantic ontology, forming a network structure. The network is more comprehensive than the tree query. When searching, it can query all entities related to a single entity, making the final query results more comprehensive. Attached Figure Description
[0016] To more clearly illustrate the embodiments of this application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, provided for at least one embodiment of this application; Figure 2 A knowledge question-answering flowchart for at least one embodiment of this application, which provides a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology; Figure 3 An architecture diagram of a question-and-answer system for a knowledge base of traditional settlements and buildings in ethnic minority areas based on large language models and knowledge graph technology, provided for at least one embodiment of this application; Figure 4 A knowledge graph structure diagram of a question-and-answer system for a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, provided for at least one embodiment of this application; Figure 5 A semantic ontology logical relationship diagram for a question-answering system based on a knowledge base of traditional settlements and architecture in ethnic minority areas, provided for at least one embodiment of this application; Figure 6 This application provides a semantic description system diagram of architectural plan components for a question-and-answer system based on a knowledge base of traditional settlements and architecture in ethnic minority areas, provided in at least one embodiment of the present application. Detailed Implementation
[0018] The following specific embodiments illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] It should be noted that the steps in the claims and description of this application may be performed substantially in parallel or in reverse order where appropriate, depending on the function involved. The terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0020] It should also be noted that the terms “step 1),” “step 2),” “step 3),” etc. in the claims and description of this application are used to distinguish different steps, rather than to describe a specific order or sequence. It should be understood that these steps may be performed substantially in parallel or in reverse order, depending on the function involved.
[0021] Furthermore, the technical features involved in the different embodiments of this application described below can be combined with each other as long as they do not conflict with each other.
[0022] This application is the first attempt in the field of architectural history and heritage conservation to use a knowledge base based on large language models and knowledge graph technology. It can realize an intelligent research workflow that integrates artificial intelligence and researchers, and is conducive to exploring new paradigms for artificial intelligence to enhance architectural heritage research.
[0023] (1) In terms of knowledge base content, there has been no dedicated knowledge base system based on a large language model for the study of traditional settlements and architectural heritage in ethnic minority areas. Data processing and analysis mainly rely on manual labor, which consumes a lot of time and manpower. Moreover, there may be problems such as inconsistent standards, inaccuracies, incompleteness, and difficulty in querying data during the data processing and processing process. Establishing a knowledge base for the study of architectural heritage in ethnic minority areas is beneficial to research projects and teaching of architectural heritage.
[0024] (2) In terms of database type selection, knowledge graph technology has better analytical and reasoning capabilities than traditional keyword fuzzy matching technology, resulting in higher query accuracy and more complete answers. Traditional methods can only retrieve information from the original text of the input data and cannot make further inferences based on the original text; knowledge graph technology can trace the relationships between things, starting from finding things and then tracing their causal chain, which improves data understanding and provides a correct and reliable basis for logical reasoning of large language models.
[0025] (3) During the data collection phase, the knowledge base based on the large language model can integrate structured, semi-structured, and unstructured data. Previous technologies could not fully process this data, but now, with the help of artificial intelligence, it can be quickly summarized and processed automatically. The large language model can transform the content of field interviews, historical documents, etc., into a data structure of entities plus relationships, realize the automatic identification of the relationships between entities, and based on the knowledge graph of building elements based on semantic ontology, it can automatically analyze and reason about the entire database, and realize high-dimensional overall query and retrieval.
[0026] One embodiment of this application provides a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, referencing... Figure 1 , Figure 1 The flowchart provided in at least one embodiment of this application illustrates a method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology. It should be understood that the method may also include additional boxes not shown and / or the boxes shown may be omitted, and the scope of this application is not limited in this respect.
[0027] In this application, the knowledge base construction method and the knowledge question answering method are mainly completed through the following steps, where steps 1) to 3) are the knowledge base construction method and steps 4) to 8) are the question answering method.
[0028] Step 1) Semantic ontology data processing: The architectural survey data in the field survey data is converted into semantic ontology data. The semantic ontology data structure is consistent with the entity table and relation table, and then directly imported into the neo4j graph database through a script.
[0029] Step 2) Processing of structured data: Other structured data from the field survey data and literature collection data are split into multiple entity tables and relation tables according to the data content, and then directly imported into the neo4j graph database through a script.
[0030] Step 3) Processing unstructured data: Save the unstructured data (including interview records, historical documents, etc.) from the field survey data and literature collection data in .txt text format, and then process it through the GraphRAG module framework to finally generate data in the neo4j graph database (i.e., organize it into the structure of entities and relations and import it into the graph database).
[0031] Step 4) Create prompt words: Extract the entity types stored in the neo4j graph database, export them as an entity type table, and create AI prompt words for entity type word segmentation.
[0032] Step 5) Constructing a large language model query module: Construct a query module for the large language model using the LangChain development framework module. Organize the user's input question string and AI prompt words as the first input item, and use the large language model to answer the query statement in the neo4j graph database as the first output item.
[0033] Step 6) Graph database query: Use the query statement generated in the previous step as the second input to query the neo4j graph database, and use the query result as the second output.
[0034] Step 7) Query result polishing: The second output item returned in the previous step is the descriptive data of entities and relationships. This is used as the third input item and polished by the large language model to be transformed into natural language and conventional data structure output as the third output item.
[0035] Step 8) Result Processing: The front end processes the third output result data returned in the previous step and renders it as text paragraphs, tables, etc. on the page.
[0036] Specifically, the workflow of the knowledge base for traditional settlements and architecture in ethnic minority areas includes four stages: questioning, large language model decomposition, Graph RAG data preparation, and large language model generation, ultimately yielding the answer, with reference to... Figure 2 .
[0037] The system in the technical solution provided in this application mainly includes two core components: A knowledge base on traditional settlements and architecture in ethnic minority areas, and a knowledge base query and question-answering system based on a large language model.
[0038] The knowledge base was primarily constructed using knowledge graph technology, with Neo4j, a graph database, chosen for data storage and basic query functionality. The question-answering system utilized mainstream large language models and their development frameworks, employing a solution centered around LangChain to implement natural language question-answering capabilities. (References) Figure 3 The knowledge base comprises three main parts: a large language model, a front-end, and a back-end. Specific technical details are as follows: 1. Large Language Model The knowledge base system supports integration with large language models (i.e., Figure 2Large Language Models (LLMs) are divided into two main categories: commercial LLMs and open-source LLMs. Common commercial LLMs include international examples like ChatGPT, Claude, and Gemini, and domestic examples like deepseek-r1, Alibaba's Tongyi Qianwen, and Baidu's Wenxin Yiyan. These systems implement knowledge-based question-and-answer functions by calling official APIs. Open-source LLMs, on the other hand, utilize the general API provided by Ollam, a LLM management tool, to implement question-and-answer functions. Open-source LLMs include models such as deepseek-r1, llama, phi, gemma, wizardlm, and qwen.
[0039] During the data processing phase, the large language model processes and analyzes unstructured data to generate corresponding entity and relation data, which are then stored in a graph database to construct a complete knowledge graph.
[0040] During the knowledge-based question-answering phase, the large language model breaks down the question and generates query statements for a graph database to facilitate accurate retrieval. The results retrieved from the knowledge base are then reassembled into logical and academic natural language feedback for the user.
[0041] 2. Backend The knowledge base system's backend is divided into the GraphRAG module, the general function module, the LangChain development framework module, and the REST API interface.
[0042] The GraphRAG module provides data processing capabilities for analyzing, transforming, and storing the raw data needed to build a knowledge base, forming the foundation for constructing knowledge graphs. Specifically, the GraphRAG module includes graph construction, processing, and saving functions, as well as text loading and transformation capabilities.
[0043] The general functional module includes the core of the knowledge graph—the Neo4j graph database, which provides basic query and analysis functions for the knowledge base. In addition, this general functional module also includes basic functions such as user permission system management, file management, and data management.
[0044] The LangChain development framework module provides users with the ability to interact with the underlying system. It includes standardized methods for calling large language model APIs, allowing direct access to both commercial and open-source large language models. The Agent module is an AI toolkit that enables AI to perform reasoning and computation on data.
[0045] All backend functions are uniformly provided to the frontend for invocation through a standardized encapsulated REST API interface. This completes the entire process of raw knowledge data processing, storage, management, querying, and interaction.
[0046] 3. Frontend The front end includes the system entry point, functional pages, and the underlying front end framework.
[0047] The front-end is primarily used to call the back-end's REST API interfaces and implement the various functions of the knowledge base system in a visual manner. The front-end integrates various elements through an underlying framework, encapsulating various business components (i.e.,...) Figure 3 In the context of components 1, 2, ..., n, multiple business components are combined to form individual pages (i.e., ... Figure 3 The system consists of multiple pages (Page 1, Page 2, ..., Page n) that together constitute the entire functional page. The front end provides an interface for researchers to interact with the knowledge base system, allowing them to use the system in a standard and intuitive manner.
[0048] In some embodiments, the construction of the knowledge base primarily utilizes knowledge graph technology, and building the knowledge graph is the core of this system. Semantic ontology serves as the theoretical basis for data modeling rules, leading to the construction of a knowledge graph of building elements based on semantic ontology. The process of processing raw data and constructing the knowledge graph can be logically divided into two layers: the schema layer and the data layer. The schema layer is built on top of the data layer and is the core of the knowledge graph. An ontology library is usually used to manage the schema layer of the knowledge graph.
[0049] Specifically, an ontology is a conceptual template for a structured knowledge base. A knowledge base formed through an ontology not only has a strong hierarchical structure but also low redundancy.
[0050] Schema layer: Entity-Relationship-Entity, Entity-Attribute-Attribute Value.
[0051] The data layer mainly consists of a series of facts, and knowledge will be stored in units of facts.
[0052] Specifically, if facts are expressed using triples such as (entity 1, relation, entity 2) or (entity, attribute, attribute value), a graph database can be chosen as the storage medium. Data layer: Building – Belongs to – Owner, Roof – Slope – 45 degrees.
[0053] In some embodiments, the technical architecture of a knowledge graph consists of information extraction, knowledge fusion, and knowledge processing.
[0054] Specifically, refer to Figure 4 , Figure 4The image shows the components of a knowledge graph. From left to right, these components are listed in the order they were constructed, with lines and arrows indicating the logical relationships between them during the construction process.
[0055] The data on the far left represents the data foundation required to build a knowledge graph, which is divided into structured data, semi-structured data, and unstructured data. Structured data typically refers to data with a clear format and structure, such as tables. Semi-structured data is data that has some structure, such as XML or JSON files. Unstructured data refers to data without a fixed format, such as text, images, or videos.
[0056] The middle section is the knowledge base construction process, which consists of three stages: information extraction, knowledge fusion, and knowledge processing. The information extraction stage primarily involves processing data. Structured data, due to its clear hierarchical structure, can be directly split or integrated according to the content required by the knowledge base. Semi-structured and unstructured data are organized based on their text content, mainly dividing the text into standardized entities, relationships, and attributes. Entities represent specific objects or concepts in the real world, relationships are the connections between entities, and attributes are certain characteristic information of entities. After data processing, the knowledge fusion stage begins, summarizing and processing all data to eliminate contradictions, redundancies, and ambiguities. Then comes the knowledge processing stage, where the results of the knowledge fusion stage are evaluated for quality. If multi-level relationships exist, ontology extraction, or knowledge summarization, is also required. The summarized results also need quality evaluation. Results that pass the evaluation can be stored in a graph database to form a knowledge graph.
[0057] During the use of knowledge graphs, some reasoning is performed on the knowledge. The results of this reasoning will form new knowledge. The newly generated knowledge data still needs to go back to the previous step for quality assessment. The new knowledge that passes the assessment will be directly added to the knowledge graph.
[0058] In this application, semantic ontology (Ontolog) is defined as follows: Originally a philosophical concept used to study the essence of the existence of objective things, it has been redefined with the advent of artificial intelligence and is now widely used in multiple fields. It is defined as: a method for depicting the basic information system and vocabulary construction network of a research field through the explicit definition of concepts, terms, and their interrelationships. (Reference) Figure 5 This study used the Hozo-Ontology software developed by Osaka University to divide the research content into different entities and relations. Entities were divided into primary (super) and secondary (sub) levels, and the relations were mainly categorized into three types: is-a (inclusion relation), pro (partial relation), and a / o (attribute relation). (Reference) Figure 6We use semantic ontology to analyze the architectural plan components.
[0059] Knowledge graphs are structured semantic knowledge bases used to quickly describe concepts and their relationships in the physical world. By effectively processing, handling, and integrating complex document data, knowledge graphs transform them into simple and clear triples of "entity, relation, entity," ultimately aggregating a large amount of knowledge to achieve rapid knowledge response and reasoning.
[0060] Through the methods or systems described above: (1) The first dedicated knowledge base for the study of traditional settlements and architecture in ethnic minority areas based on large language model and knowledge graph technology has been realized: the knowledge base in the vertical field of architecture includes categories such as building engineering and building codes. Common data sources include professional code data, design documents of various professions, engineering-related books, engineering-related research papers, project feasibility study reports, and reports from experts in the field of architecture. However, it lacks historical research books and papers on existing settlements and architecture in ethnic minority areas, basic survey data sets, survey reports, on-site survey drawings, and other data.
[0061] (2) In terms of database type selection, graph databases provide more comprehensive query results than traditional databases. In field surveys, semantic ontology is used to decompose settlements and building entities into different entities and relationships. The semantic ontology method is upgraded to knowledge graphs, and the relationship between entities is upgraded from a tree structure to a network structure. The mutual association between entities is more comprehensive, thus having analytical and reasoning capabilities. Therefore, choosing a graph database based on knowledge graphs can query all entities associated with a single entity and has analytical and reasoning capabilities, thus achieving higher accuracy and more complete answers than previous queries.
[0062] (3) In the data collection stage, the knowledge base based on the big language model can integrate structured and unstructured data. It can transform the content of field interviews, historical documents and other content into structured data through the big language model, realize the automatic identification of the relationship between entities, and thus achieve automatic analysis and reasoning of graph database. The modeling method of semantic ontology is introduced to provide a theoretical basis for entity division in knowledge graph. The building is decomposed into components such as roof tiles and wooden beams and columns, and the relationship between different entities is sorted out to construct a knowledge graph of building elements based on semantic ontology, forming a network structure. The network is more comprehensive than the tree query. When searching, it can query all entities related to a single entity, making the final query results more comprehensive.
[0063] This application may be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this application.
[0064] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0065] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0066] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 via 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., via the Internet using an Internet service provider). In some embodiments, electronic circuits, such as programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), are personalized by utilizing the status information of the computer-readable program instructions. These electronic circuits can execute the computer-readable program instructions to implement various aspects of this application.
[0067] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0068] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0069] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0070] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0071] Note that, unless otherwise explicitly stated, all features disclosed in this specification (including any appended claims, abstract, and drawings) may be replaced by alternative features for achieving the same, equivalent, or similar purpose. Therefore, unless explicitly stated otherwise, each disclosed feature is merely one example of a set of equivalent or similar features. Where used, "further," "preferably," "even further," and "more preferably" are simply starting points for describing another embodiment based on the foregoing embodiments, the combination of which with the foregoing embodiments constitutes the complete configuration of another embodiment. Any combination of several "further," "preferably," "even further," or "more preferably" settings following the same embodiment constitutes yet another embodiment.
[0072] Although this application has been described in detail above with general descriptions and specific embodiments, some modifications or improvements can be made to it, which will be obvious to those skilled in the art. Therefore, all such modifications or improvements made without departing from the spirit of this application fall within the scope of protection claimed in this application.
Claims
1. A method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology, characterized in that, Includes the following steps: The traditional settlements and architectural survey data of ethnic minority areas in the field survey data are transformed into semantic ontology data. The semantic ontology data structure is consistent with the entity table and relation table. Then, it is directly imported into the neo4j graph database through a script. The field survey data and other structured data from the literature collection data are split into multiple entity tables and relation tables according to the data content, and then directly imported into the neo4j graph database through a script; Unstructured data from field surveys and literature collections are saved in .txt text format, then processed using a large language model combined with the GraphRAG module framework to finally generate data in the neo4j graph database. Extract the entity types stored in the neo4j graph database, export them as an entity type table, and create AI suggestion words for entity type word segmentation; The query module of the large language model is built through the LangChain development framework module. The user input question string and AI prompt words are sorted out as the first input item, and the query statement in the neo4j graph database is answered by the large language model as the first output item. Use the generated query statement as the second input to query the neo4j graph database, and use the query result as the second output. The second output item contains descriptive data of entities and relationships. Using the second output item as the third input item, it is refined by a large language model and transformed into natural language and a conventional data structure as the output, which is then used as the third output item.
2. The method for constructing a knowledge base of traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 1, characterized in that, After outputting the third output item, the following is also included: The third output result data is processed and rendered as text paragraphs and table content on the page.
3. A question-and-answer system based on a knowledge base of traditional settlements and architecture in ethnic minority areas, using large language models and knowledge graph technology, characterized in that... include: The knowledge base includes a large language model, a front-end, and a back-end, wherein: The large language model implements knowledge question answering functionality through API. In the data processing stage, the large language model processes and analyzes unstructured data to generate corresponding entity and relation data, which are then stored in a graph database to construct a complete knowledge graph. In the knowledge question answering stage, the large language model breaks down the question and generates query statements for the graph database. The retrieved results from the knowledge base are then reassembled into logical and academic natural language feedback for the user. The backend includes a GraphRAG module, a general function module, a LangChain development framework module, and a REST API interface. The GraphRAG module is used to analyze, transform, and store the raw data required to build the knowledge base. The general function module includes a Neo4j graph database, which provides storage, query, and analysis functions for the knowledge base. The LangChain development framework module provides users with the ability to interact with the underlying system. The REST API interface is provided for the frontend to call. The front end includes a system entry point, functional pages, and a front end underlying framework. The front end is used to call the back end's REST API interface. The underlying framework integrates various contents and encapsulates various business components. Multiple business components are combined to form individual pages, and multiple pages together constitute the entire functional page.
4. The question-and-answer system for traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 3, characterized in that: The large language model includes a commercial large language model and an open-source large language model. The commercial large language model implements the knowledge question-and-answer function by calling the official API, while the open-source large language model implements the question-and-answer function through the general API provided by the large language model management tool Ollama.
5. The question-and-answer system for traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 3, characterized in that: The general functional modules also include basic functions such as user permission system management, file management, and data management.
6. The question-and-answer system for traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 3, characterized in that: The LangChain development framework module contains standardized methods for calling large language model APIs.
7. The question-and-answer system for traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 3, characterized in that: The knowledge base was constructed using a knowledge graph technology solution, which is logically divided into a schema layer and a data layer. The schema layer is built on top of the data layer, and an ontology library is used to manage the schema layer of the knowledge graph. The data layer consists of a series of facts, and knowledge is stored in units of facts.
8. The question-and-answer system for traditional settlements and architecture in ethnic minority areas based on large language models and knowledge graph technology according to claim 3, characterized in that: The technical architecture of the knowledge graph consists of information extraction, knowledge fusion, and knowledge processing.
Citation Information
Patent Citations
Intelligent question and answer implementation method and system fusing large model and knowledge base, and medium
CN117313857A
Building safety risk identification method of large language model-assisted knowledge graph
CN120542919A
Composite symbolic and non-symbolic artificial intelligence system for advanced reasoning and semantic search
US20240386015A1