A method for mining and displaying cultural features based on knowledge graph and generative big model

By building a knowledge map of historical and cultural resources and using generative large models, the problem of insufficient scientificity and accuracy of cultural characteristics mining and display in the existing technology is solved, and more efficient display of cultural characteristics and protection of historical and cultural resources is achieved.

CN119760137APending Publication Date: 2025-04-04JIANGSU INST OF URBAN PLANNING & DESIGN
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411825725.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing technology lacks scientificity and accuracy in the exploration and display of cultural characteristics of historical and cultural resources, and the display effect is not visualized enough.

Method used

Using a method based on knowledge graph and generative big model, cultural characteristics are extracted by constructing a knowledge graph of historical and cultural resources, and using generative big model to query and display the characteristics of cultural resources.

Benefits of technology

It improves the scientificity and accuracy of cultural characteristics mining, enhances the visualization effect of cultural characteristics display, and provides better guidance for the protection of historical and cultural resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760137A_ABST
    Figure CN119760137A_ABST
Patent Text Reader

Abstract

The present invention discloses a method for mining and displaying cultural characteristics based on a knowledge graph and a generative large model, which relates to the fields of urban and rural planning and design, and historical and cultural protection technology; the management attributes and cultural attribute information of historical and cultural resources are collected, a cultural resource knowledge graph is constructed by an RDF triple method, and a natural language generation scheme for historical and cultural resources is constructed by a generative large model method, and the cultural characteristics of historical and cultural resources are mined and visualized. The method of the present invention mines and displays cultural characteristics through a knowledge graph and a generative large model, which can improve the scientificity and accuracy of cultural characteristic mining, improve the visualization effect of cultural characteristic display, and help improve the objectivity and scientificity of government departments in protecting historical and cultural heritage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of historical and cultural protection, inheritance and utilization, and in particular to a cultural feature mining and display method based on a knowledge graph and a generative large model. Background Art

[0002] In the protection of historical and cultural resources, cultural characteristics and excavation are important links in historical and cultural protection. The excavation and display of cultural characteristics are important areas of concern for disciplines such as urban and rural planning and design, historical and cultural protection, and cultural education and publicity. The excavation and display of cultural characteristics are of great value for historical and cultural resource protection, resource management, and cultural display and publicity. The use of new generation information technology methods to excavate and display cultural characteristics can provide new methods and new perspectives for the digital management and display of historical and cultural resources.

[0003] At present, there are many methods for mining and displaying the cultural characteristics of historical and cultural resources, including text analysis, system construction, information monitoring, electronic archives, etc. However, most of them need to rely on experience and judgment, and the methods are relatively traditional. The scientificity and accuracy of cultural characteristic mining need to be further improved. Summary of the invention

[0004] The problem to be solved by the present invention is to provide a method for mining and displaying cultural features based on a knowledge graph and a generative large model, so as to improve the scientificity and accuracy of cultural feature mining and improve the visualization effect of cultural feature display.

[0005] The present invention adopts the following technical solution: a method for mining and displaying cultural features based on a knowledge graph and a generative large model, comprising the following steps:

[0006] S1. Construct a basic database of historical and cultural resources: collect and organize the management attributes of cultural resource points, supplement cultural attributes, and form a basic database of cultural resources with spatial mapping relationships;

[0007] S2. Identify cultural attributes related to historical and cultural resources: Extract place names, personal names and deeds information of cultural resources based on the big model;

[0008] S3. Constructing the knowledge graph of historical and cultural resources: constructing the management attribute and cultural attribute knowledge graphs respectively through RDF triples, integrating the cultural resource knowledge graph by name consistency, and visualizing it through the Neo4j platform;

[0009] S4. Extract the characteristics of historical and cultural resources: Based on the knowledge graph of historical and cultural resources, generate a word vector matrix, perform spectral clustering on the word vector matrix, and extract the cultural characteristics of the knowledge graph under unsupervised conditions;

[0010] S5. Construct a large historical and cultural model: Build a cultural resource database and conduct RAG search enhancement generation;

[0011] S6. Query and display of historical and cultural resource features: Build a language model dialogue framework to convert natural language text into structured data for query, and convert the retrieved data into natural language text for user understanding and reading.

[0012] Preferably, step S1 constructs a basic database of historical and cultural resources in the following manner:

[0013] S1.1. Collect historical and cultural resource data, compile a list of historical and cultural resources, and create digital archives based on the management attributes of historical and cultural resources to form electronic archives of cultural resource sites;

[0014] The electronic archives of the cultural resource sites include: basic information table, current status photos, geographic coordinate information, protection boundaries, architectural surveying and mapping data, management data, and historical documents

[0015] S1.2. Based on the electronic archives of cultural resource points, extract the management attributes that are highly relevant to the cultural resource points, including: name, category, level, and city to which they belong; according to the location information of cultural resources, combine the geocoding method to place the cultural resources in the geographic space, convert them into vector data with geographic information, and form a basic database of cultural resources with spatial mapping relationships;

[0016] S1.3. Supplement cultural attributes based on the cultural resource basic database; the cultural attributes are expressed through the celebrities and deeds related to the cultural resource points. According to the name of the cultural resource point, the Selenium tool library in the Python language is used to obtain the corresponding encyclopedia network URL link, and the HTML introduction content in the link is comprehensively analyzed using regular expressions to obtain cultural attribute text data, which is stored in the celebrity and deeds field in the form of a string to supplement the data corpus.

[0017] Preferably, step S2 identifies cultural information related to historical and cultural resources, structures the supplementary cultural attribute text data, batch extracts and summarizes text data field information through a generative large model, obtains place names, celebrities and deeds information in the text data, and performs data cleaning, merges duplicate celebrities, and sets fields for storage of the cleaned characters, place names, and deeds, forming a data foundation for knowledge graph construction.

[0018] Preferably, step S3 constructs a historical and cultural resource knowledge graph in the following manner:

[0019] S3.1. Based on the RDF triple method, knowledge graphs are constructed for management attribute and cultural attribute data respectively, and each factual relationship is represented as a triple, including: head entity, relationship, and tail entity;

[0020] S3.2. Establish connections between management attribute knowledge graphs to form cultural resource labels, including: name, protection category, classification level, city, county, type, batch, longitude and latitude coordinates, and age benchmark; starting from the name of cultural resources, map the graph through the Neo4j platform to connect historical protection information, administrative management information, and geographic space information;

[0021] S3.3. Establish connections between knowledge graphs of cultural attributes, use the relationships between celebrities, place names, and deeds to build a knowledge graph, input the association between deeds and celebrities into the big model, and obtain the attributes of the relationship between people and land; perform graph mapping through the Neo4j platform, and connect historical protection information, administrative management information and geographic space information, cultural attributes, and the attributes of the relationship between people and land;

[0022] S3.4. Take the constructed management knowledge map as the outer layer, the cultural knowledge map as the inner layer, and the cultural resource name as the core connection point to form a historical and cultural resource knowledge map that combines the inside and the outside, which is used to summarize the characteristics of historical and cultural resources and show the implicit connection between historical and cultural resources, cultural resources and cultural celebrities;

[0023] S3.5. Based on the constructed historical and cultural resource knowledge graph, HTML5, JavaScript, CSS and Echarts tool library are used for network visualization, including front-end display, back-end query, front-end and back-end interaction, which is used for click-to-view, search and multi-level expansion of the network knowledge graph.

[0024] Preferably, step S4 extracts the characteristics of historical and cultural resources in the following manner:

[0025] S4.1. Use the Word2vec tool to put the text content of the historical and cultural resource knowledge graph into the algebraic space, perform word embedding, and use w as the current word placed in the vector space. t-1 、w t+1 Representing the words before and after w, forming an adjacency matrix in the vector space, forming a word vector matrix with a total size of V in the order of precedence;

[0026] S4.2. Using the connection relationship between knowledge graphs, we add the correlation dimension on the basis of the word vector matrix, perform spectral clustering on the word vector matrix, input V into the spectral clustering model N, and obtain the predicted classification. The formula is expressed as:

[0027] w V×N ={w kt}

[0028] Among them, w kt Refers to w in the kth clustering case t, represents the specific classification of the vocabulary after the word vector matrix V is placed into the spectral clustering model, {w kt} refers to w kt A collection of;

[0029] S4.3. Obtain the distribution of cultural characteristics through clustering analysis, summarize the correspondence between the characteristics displayed by the clustering and the geographic space mapping, and extract and output the cultural characteristics of the unsupervised knowledge graph.

[0030] Preferably, step S5 constructs a historical and cultural model in the following manner:

[0031] S5.1. Build a cultural resource database, including: a cultural resource knowledge question and answer database, cultural resource text introductions and pictures, and a generative large model training data set;

[0032] S5.2, RAG retrieval enhancement generation: Adopt the retrieval enhancement generation method, integrate the external knowledge base, directly access the latest information through the large language model, and generate retrieval-based output information; adopt the error correction retrieval enhancement generation method, including inputting questions, retrieving vector database documents, evaluating documents, re-retrieval, generating answers, and evaluating and enhancing the relevance of retrieved documents through evaluators and network searches.

[0033] Preferably, in step S6, the language model dialogue framework includes: a natural language understanding module, a dialogue management module, a database query module, and a natural language generation module;

[0034] The natural language understanding module uses the GLM4 generative language model to convert natural language text into structured data, including the intention judgment submodule and the entity slot filling submodule;

[0035] The dialogue management module is used to coordinate and control the question-answering interaction process to ensure that user questions are correctly understood and effectively answered, including the dialogue state tracking submodule and the strategy selection submodule;

[0036] The database query module retrieves information from the cultural resource knowledge database to answer user questions, including a database connection submodule and a data retrieval submodule;

[0037] The natural language generation module converts the retrieved information or processed data into natural language text, organizes the extracted content using predefined templates or structures, and provides users with understanding and reading.

[0038] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0039] 1. The present invention independently collects information related to historical and cultural resources, extracts cultural resource graph relationships with the help of a large model, and mines and displays cultural features based on a knowledge graph and a generative large model method; the analysis process only needs to input the collected relevant cultural resource data into the knowledge graph and the generative large model framework to quickly construct a cultural resource graph relationship, form a knowledge graph, and build a natural language question-answering module, thereby improving the current situation of serious fragmentation of historical and cultural resource information, low knowledge coupling, and weak knowledge correlation, improving the visualization presentation effect of historical and cultural resources, and providing guidance for the protection of historical and cultural resources.

[0040] 2. The present invention constructs a language model dialogue framework including a natural language understanding module, a dialogue management module, a database query module, and a natural language generation module, which converts natural language text into structured data to query the database, and converts the retrieved data into natural language text for user understanding and reading. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flow chart of the method for mining and displaying cultural features based on the knowledge graph and the generative big model of the present invention;

[0042] Figure 2 It is a flow chart of constructing the knowledge graph of historical and cultural resources of the present invention;

[0043] Figure 3 It is a schematic diagram of the knowledge graph of the present invention;

[0044] Figure 4 It is the online front-end and back-end transmission and interaction logic block diagram of the present invention;

[0045] Figure 5 is a flow chart of extracting cultural features of the present invention;

[0046] Figure 6 It is the technical framework diagram of the cultural macro model of the present invention;

[0047] Figure 7 It is a schematic diagram of the natural language generation interface of an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the application is further elaborated in detail below in conjunction with the accompanying drawings. The described embodiments are only a part of the embodiments involved in the present invention. All non-innovative embodiments of other researchers in the field on this embodiment belong to the protection scope of the present invention. At the same time, for the step numbering in the embodiment of the present invention, it is only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0049] In one embodiment of the present invention, a method for mining and displaying cultural features based on a knowledge graph and a generative large model is provided. Figure 1 As shown, the following steps are included:

[0050] The first step is to build a basic database of historical and cultural resources: collect and organize the management of cultural resource points and cultural attributes, form a cultural resource database with spatial mapping relationships, and supplement the corpus of celebrities and deeds related to cultural resources.

[0051] 1.1. Collect historical and cultural resource data, compile a list of historical and cultural resources, digitally archive the management attributes of historical and cultural resources, and form an electronic archive of cultural resource points.

[0052] Preferably, in this embodiment, the electronic archive includes: basic information table, current status photos, geographic coordinate information, protection boundaries, building surveying and mapping data, management data, historical document data and other data.

[0053] 1.2. Based on the electronic archives, some management attributes that are highly relevant to cultural resource points are extracted, including name, category, level, city, etc. According to the specific location of cultural resources, combined with geocoding technology, all cultural resources are placed in geographic space and converted into vector data with geographic information, forming a basic cultural resource database with spatial mapping relationship.

[0054] 1.3. On the basis of complete database management attributes and spatial mapping relationships, cultural attributes are supplemented. The cultural attributes of cultural resource points are mainly expressed through the relevant celebrities and deeds of the resource points.

[0055] Preferably, in this embodiment, the data source is Baidu Encyclopedia and Wikipedia's compilation of celebrity and deeds at resource points.

[0056] First, according to the name of the cultural resource point, the Selenium tool library in Python language is used to obtain the URL link of the cultural resource point in Baidu Encyclopedia and Wikipedia; secondly, regular expressions are used to comprehensively analyze the HTML introduction content in the link; finally, the obtained content is stored in the "Celebrity and Deeds" field.

[0057] The second step is to identify cultural information related to cultural resources: extract cultural resource place names, personal names and deeds based on the big model.

[0058] 2.1. Since the extracted celebrities and deeds are texts composed of strings, they are unstructured data. It is necessary to further visualize the database of cultural resource points with spatial mapping relationships, further structure the supplementary cultural attributes, establish connections with management attributes such as names, categories, and levels, and form a cultural resource knowledge graph with management and cultural attributes. The technical route of knowledge graphs, such as Figure 2 shown.

[0059] 2.2. Structuring cultural attribute text data.

[0060] Preferably, in this embodiment, the generative big model is used to batch extract and summarize the information in the field, and the two fields of "Celebrity and Deeds Baidu" and "Celebrity and Deeds Wiki" are input using the Spark Big Model API. At the same time, relevant instructions are sent to the Spark Big Model to extract and summarize the input text. After repeated testing, it is confirmed that the better result is to set the text randomness to the lowest, and the instruction setting is similar to "You are a data cleaning expert. Please help me clean out the characters from the following passage: 'The Humble Administrator's Garden was built in the fourth year of Ming Zhengde (1509). It was built on the site of Lu Guimeng's residence in the Tang Dynasty and the site of Dahong Temple in the Yuan Dynasty after Wang Xianchen, a Jinshi and censor of the Ming Dynasty, abandoned his official position and returned to his hometown'. Please strictly use 'The cleaned data is as follows: Person 1; Person 2' as the structure to ensure that the format of each part is completely unified" to obtain relevant place names, celebrities and deeds in the text.

[0061] Taking the example given in the command setting as the return result, it is "the cleaned data is as follows: Wang Xianchen; Lu Guimeng", enter all the fields to get the return result. Merge the repeated celebrities in Baidu Encyclopedia and Wikipedia, set the cleaned characters, place names, and deeds into fields for storage, and form the data foundation for the construction of the knowledge graph.

[0062] The third step is to construct a cultural resource knowledge graph: construct a cultural resource knowledge graph through RDF triples and visualize the knowledge graph.

[0063] 3.1. Based on the RDF triple principle, knowledge graphs are constructed for data according to management and cultural attributes. That is, each factual relationship is represented by a triple, head entity, relation and tail entity. The management and cultural knowledge graphs are integrated into a graph mapping of the cultural resource database by using the consistency of the names and displayed on the network.

[0064] According to the RDF triple method, attribute labels and relationships are combined to form multiple triples. Finally, the triples are mapped to the visualization display end to complete the construction of the knowledge graph. The knowledge graph mapping of the database is mainly integrated using the Neo4j platform.

[0065] 3.2. In terms of management knowledge graphs, the traditional structured method is combined with triples to establish the connection between management attribute knowledge graphs, forming labels such as name, category, level, city, county, type, batch, longitude and latitude coordinates, and age benchmark. Taking the name of cultural resources as the starting point, Neo4j is used to connect the three parts of management content, namely historical protection information (protection category, classification level), administrative approval information (management department, approved batch) and geographic spatial information (city and county affiliation, specific address, longitude and latitude coordinates), to realize information query and data management of historical resource protection, utilization and management.

[0066] 3.3. In terms of cultural knowledge graph, the relationship between existing celebrities, place names, and deeds is used to construct a knowledge graph. The specific method is to input the association between deeds and celebrities into the Spark Big Model API, set the text randomness to the lowest, refer to the instructions for extracting celebrities, deeds, and place names, give instructions for finding the association between celebrity deeds and cultural resources, and use the returned keywords as the attributes of the relationship between people and land. Then use Neo4j to integrate the data of cultural resource points in five aspects: protection category (category, level), administrative management (approval department, approval batch, construction age), geographic information (city and county affiliation, latitude and longitude, affiliated river), cultural attributes (water bodies, settlements, gardens, buildings, etc.), and relationship between people and land (related names, related place names), and finally output the knowledge graph framework of cultural resource name-attribute label-specific information.

[0067] 3.4. Based on the construction of management and cultural attribute knowledge graphs, the management knowledge graph is used as the outer layer, the cultural knowledge graph is used as the inner layer, and the cultural resource name is used as the core connection point. The management attributes such as age and city are placed on the outside, and the characters and relationships are placed on the inside to form a general map of the historical and cultural resource knowledge graph that combines the inside and the outside, such as Figure 3 The general map will be used to summarize the characteristics of historical and cultural resources and to show the implicit connections between historical and cultural resources, cultural resources and cultural celebrities.

[0068] 3.5. The constructed knowledge graph is visualized on the network using HTML5, JavaScript, CSS and Echarts tool library, which includes three parts: front-end display, back-end query and front-end and back-end interaction. Figure 4 shown.

[0069] Use the py2neo library to connect and operate the Neo4j graph database, link the front-end and back-end through Flask, and use JQuery to achieve dynamic interaction and AJAX requests. Complete the functions of click-to-view, search, multi-level expansion, etc. of the network-side knowledge graph.

[0070] The fourth step is to extract the cultural characteristics of historical and cultural resources: generate a word vector matrix, perform spectral clustering on the word vector matrix, and extract the cultural characteristics of the unsupervised knowledge graph.

[0071] 4.1. For the formed knowledge graph, use the word vector method Word2vec to put the text content into the algebraic space. Generate a word vector matrix, and use the connection relationship between the existing knowledge graphs to add the correlation dimension on the basis of the word vector matrix, perform spectral clustering on the word vector matrix, and extract the cultural characteristics of the unsupervised knowledge graph, such as Figure 5 shown.

[0072] 4.2. Use the Word2vec tool to embed the text in the knowledge graph, and use w as the current word placed in the vector space. The front and back can be represented by w respectively. t-1 、w t+1 Representing the words before and after w, an adjacency matrix is ​​formed in the vector space, forming a word vector matrix with a total size of V in the order of precedence, supplementing the original connectivity relationship in the knowledge graph to further enrich the dimension of the matrix, and inputting V into the spectral clustering model N to obtain the predicted classification, which is expressed as follows:

[0073] w V×N ={w kt}

[0074] Among them, the brackets refer to sets, w kt Refers to w in the kth clustering case t , which means the specific classification of vocabulary obtained after the word vector matrix V is placed into the spectral clustering model. The distribution of cultural characteristics is obtained by analyzing the clustering situation, and the correspondence between the characteristics shown by the clustering and the geographic space mapping is summarized to output the cultural characteristics of the cultural resource database and knowledge graph.

[0075] The fifth step is to construct a large cultural model: build a cultural resource database and perform RAG retrieval enhancement and generation.

[0076] 5.1. Build a cultural resource database, such as Figure 6 As shown, it includes three aspects: a cultural resource knowledge question and answer database, that is, returning accurate answers by querying the database; text introductions and pictures of cultural resources to enrich the content of generative large model question and answer; and a generative large model training data set, which is data used for model training and tuning.

[0077] Based on the construction of cultural resource management attributes and cultural attribute knowledge graphs, relevant question and answer knowledge is extracted from the cultural resource knowledge graph and used to build a question and answer library to ensure the accuracy and comprehensiveness of the question and answer knowledge.

[0078] Vector database technology is used to build a cultural resource knowledge question and answer database. The vector database supports the storage, retrieval and management of high-dimensional vectors, can effectively process vector data, and provide fast similarity search and data analysis functions.

[0079] To build a cultural resource knowledge question-and-answer database, first, the nodes and edges of the knowledge graph are segmented and embedded, converted into vector form, and then stored in the vector database. The content in the database is retrieved through similarity search. The word segmenter uses the default word segmenter of the GLM4 language model. The word embedding algorithm maps the segmented words to vectors in a high-dimensional space while maintaining semantic similarity. The Word2Vec word embedding method is used to generate a more semantic vector representation based on context learning. Word2Vec predicts a word through its context (i.e., surrounding words), and takes multiple words in the context of a word as input to predict the central word.

[0080] Then, the Faiss vector database is used for vector storage.

[0081] In terms of similarity search, preferably, this embodiment uses the cosine similarity in the semantic similarity algorithm to measure the semantic similarity between the question sentence and the context sentence. The cosine similarity calculation formula is:

[0082]

[0083] Among them, A·B represents the dot product of vector A and vector B, and ∥A∥∥B∥ represents the Euclidean norm of vector A and vector B respectively; in text processing, the vector usually represents the Word2Vec vectorized representation of the text.

[0084] In addition to the cultural resource question-and-answer knowledge base, rich cultural resource information is obtained from text introductions and pictures, which usually include basic information, historical background, artistic characteristics, etc. of cultural resources. By parsing text and pictures, valuable cultural resource knowledge is extracted to answer user questions.

[0085] The text descriptions and pictures of cultural resources are also searched using vector databases and similarity retrieval algorithms.

[0086] 5.2. RAG Retrieval-Enhanced Generation. Retrieval-Enhanced Generation (RAG) technology is used to improve the accuracy, controllability, and relevance of model-generated content by integrating external knowledge bases. According to RAG, large language models are allowed to directly access the latest information without retraining, thereby generating reliable, retrieval-based output information.

[0087] Corrective Retrieval Enhanced Generation (Corrective RAG) technology is used to enhance the robustness of language model generation. The relevance of retrieved documents is evaluated and enhanced through evaluators and large-scale web searches, ensuring that more accurate and reliable information is used in the generation process.

[0088] Preferably, in this embodiment, the Corrective RAG process includes: inputting questions, searching vector database documents, evaluating documents, re-searching, generating answers, etc.

[0089] Compared with RAG, Corrective RAG adds the steps of evaluating documents and re-retrieval. In terms of evaluating documents, GLM4 is used as a retrieval evaluator to evaluate the relevance of the retrieved vector data documents with the input content, and a confidence score is returned for each document. According to the confidence score and the preset threshold, the retrieved documents are divided into three categories: correct, incorrect, and ambiguous.

[0090] If the document is classified as "correct", knowledge extraction is performed on the retrieved document, that is, it is divided into "knowledge strips" and irrelevant fragments are filtered out; if the document is classified as "wrong", web search is used to find more sources of knowledge; if the document is classified as "fuzzy", knowledge extraction algorithm and web search are combined to obtain more information.

[0091] The sixth step is to query and display the cultural characteristics of cultural resources: including natural language understanding, dialogue management, database query, natural language generation and other components.

[0092] Natural language generation is a key module responsible for converting the information retrieved by the system or the processed data into natural language text so that users can understand and read it. Predefined templates or structures are used to organize the extracted content. The template contains a fixed format and variable content positions to fill in specific information when generating text. According to the template, the natural language generation module generates text. The GLM4 large language model is used to conduct personalized and diverse question and answer based on the context. The query and display framework based on the large language model (LLM) includes components such as natural language understanding, dialogue management, database query, and natural language generation.

[0093] 6.1. Natural language understanding module converts natural language text into structured data that can be processed and analyzed by machines. This process includes the intention judgment module and the entity slot filling module. Both sub-modules use the GLM4 generative language model.

[0094] The main function of the intention judgment submodule is to understand the intention expressed by the user through natural language. In applications such as dialogue systems, chatbots, and voice assistants, intention recognition is the basis for effective interaction. The function is implemented in the following process: input preprocessing, standardizing the user's natural language input, including removing irrelevant characters, converting uppercase and lowercase letters, and extracting stems, etc., for subsequent processing.

[0095] Feature extraction, extracting features from the processed text. These features may include words, phrases, sentence patterns, contextual information, etc. These features will be used to train and predict user intent.

[0096] Model training: Use a language model to train the extracted features and learn how to distinguish different intent categories, which usually involves a large amount of labeled data and cross-validation process.

[0097] Intent classification, in practical applications, the input text is assigned to one or more intent categories based on the extracted features and the trained model.

[0098] According to the actual usage scenarios of historical and cultural resource knowledge questions and answers, the preset intent categories include: querying the name of cultural resources, querying the river to which cultural resources belong, querying the relationship between people and land, querying the era to which cultural resources belong, querying the category to which cultural resources belong, and others.

[0099] The entity slot filling submodule extracts structured information from natural language text, usually in the form of entities and corresponding slots, where entities are key information in the text (such as names, places, years, etc.), and slots are specific descriptions or attributes of these entities (such as the specific location, age, and category of a cultural resource, etc.). The implementation process of the submodule includes identifying entities, defining slots, and filling slots.

[0100] 6.2. The dialogue management module is the core of cultural resource knowledge question and answer. It is responsible for coordinating and controlling the entire question and answer interaction process to ensure that users' questions can be correctly understood and effectively answered. The dialogue management module includes two sub-modules: dialogue state tracking and strategy selection.

[0101] The dialogue state tracking submodule tracks and updates the user's intention, the content of the inquiry, and the context information of the dialogue during the dialogue process, which helps the system understand the progress of the dialogue and make appropriate responses.

[0102] The strategy selection submodule determines the next action strategy and reasonably selects different strategies such as rhetorical question, confirmation, and answering questions according to the intent and entity slot filling. The language model learns context information to learn the best dialogue strategy.

[0103] 6.3. The database query module is responsible for retrieving relevant information from the cultural resource knowledge database to answer users' questions, and includes sub-modules such as database connection and data retrieval.

[0104] The function of the database connection submodule is to connect to the database and use the semantic similarity algorithm to query the data stored in the Faiss vector database.

[0105] The data retrieval submodule executes the query and returns the results, and is responsible for evaluating the returned results and further selecting the query strategy.

[0106] 6.4. The natural language generation module is responsible for converting the information retrieved by the system or the processed data into natural language text so that users can understand and read it.

[0107] The natural language generation module uses predefined templates or structures to organize the extracted content. These templates contain fixed formats and variable content positions so that specific information can be filled in when generating text. According to the templates, the natural language generation module generates text. The natural language generation interface is as follows: Figure 7 shown.

[0108] It can be seen that this embodiment constructs a language model dialogue framework including a natural language understanding module, a dialogue management module, a database query module, and a natural language generation module, which converts natural language text into structured data to query the database, and converts the retrieved data into natural language text for user understanding and reading.

[0109] In summary, the present invention is based on the method of mining and displaying cultural characteristics of knowledge graph and generative large model, and takes the collection of management attributes and cultural attribute information of historical and cultural resources as the basis to construct the knowledge graph of historical and cultural resources, and uses Neo4j combined with Cypher language to complete the visualization of knowledge graph, and uses HTML5, JavaScript, CSS combined with image tool library Echarts to display the local knowledge graph online. Further visualize the cultural connection between historical and cultural resource place names, celebrities, and deeds, conduct cultural resource feature mining, build a natural language question-and-answer module, and use the generative large model method to complete the knowledge question-and-answer of cultural resources, which improves the current situation of serious fragmentation of historical and cultural resource information, low knowledge coupling, and weak knowledge relevance, improves the visualization presentation effect of historical and cultural resources, and can provide guidance for the protection of historical and cultural resources.

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

Claims

1. A method for mining and displaying cultural features based on knowledge graph and generative big model, characterized in that: The steps include: S1. Construct a basic database of historical and cultural resources: collect and organize the management attributes of cultural resource points, supplement cultural attributes, and form a basic database of cultural resources with spatial mapping relationships; S2. Identify cultural attributes related to historical and cultural resources: Extract place names, personal names and deeds of cultural resources based on the big model; S3. Constructing the knowledge graph of historical and cultural resources: constructing the management attribute and cultural attribute knowledge graphs respectively through RDF triples, integrating the cultural resource knowledge graph by name consistency, and visualizing it through the Neo4j platform; S4. Extract the characteristics of historical and cultural resources: Based on the knowledge graph of historical and cultural resources, generate a word vector matrix, perform spectral clustering on the word vector matrix, and extract the cultural characteristics of the knowledge graph under unsupervised conditions; S5. Construct a large historical and cultural model: Build a cultural resource database and conduct RAG search enhancement generation; S6. Query and display of historical and cultural resource features: Build a language model dialogue framework to convert natural language text into structured data for query, and convert the retrieved data into natural language text for user understanding and reading.

2. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 1 is characterized in that: Step S1 constructs a basic database of historical and cultural resources, the method is as follows: S1.

1. Collect historical and cultural resource data, compile a list of historical and cultural resources, and create digital archives based on the management attributes of historical and cultural resources to form electronic archives of cultural resource sites; S1.

2. Based on the electronic archives of cultural resource points, extract the management attributes that are highly relevant to the cultural resource points, including: name, category, level, and city to which they belong; according to the location information of cultural resources, combine the geocoding method to place the cultural resources in the geographic space, convert them into vector data with geographic information, and form a basic database of cultural resources with spatial mapping relationships; S1.

3. Supplement cultural attributes based on the cultural resource basic database; the cultural attributes are expressed through the celebrities and deeds related to the cultural resource points. According to the name of the cultural resource point, the Selenium tool library in the Python language is used to obtain the corresponding encyclopedia network URL link, and the HTML introduction content in the link is comprehensively analyzed using regular expressions to obtain cultural attribute text data, which is stored in the celebrity and deeds field in the form of a string to supplement the data corpus.

3. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 2 is characterized in that: Step S2 identifies cultural information related to historical and cultural resources and structures the supplementary cultural attribute text data. Through the generative large model, text data field information is batch extracted and summarized to obtain the place names, celebrities and deeds information in the text data, and data cleaning is performed to merge duplicate celebrities. The cleaned people, place names and deeds are set up as fields for storage respectively, forming the data foundation for the construction of the knowledge graph.

4. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 3 is characterized in that: Step S3 constructs a knowledge graph of historical and cultural resources as follows: S3.

1. Based on the RDF triple method, knowledge graphs are constructed for management attribute and cultural attribute data respectively, and each factual relationship is represented as a triple, including: head entity, relationship, and tail entity; S3.2, establish the connection between management attribute knowledge graphs, form cultural resource labels, take the cultural resource names as the starting point, map them through the Neo4j platform, and connect historical protection information, administrative management information and geographic space information; S3.

3. Establish connections between knowledge graphs of cultural attributes, use the relationships between celebrities, place names, and deeds to build a knowledge graph, input the association between deeds and celebrities into the big model, and obtain the attributes of the relationship between people and land; perform graph mapping through the Neo4j platform, and connect historical protection information, administrative management information and geographic space information, cultural attributes, and the attributes of the relationship between people and land; S3.

4. Take the constructed management knowledge map as the outer layer, the cultural knowledge map as the inner layer, and the cultural resource name as the core connection point to form a historical and cultural resource knowledge map that combines the inside and the outside, which is used to summarize the characteristics of historical and cultural resources and show the implicit connection between historical and cultural resources, cultural resources and cultural celebrities; S3.

5. Based on the constructed historical and cultural resource knowledge graph, HTML5, JavaScript, CSS and Echarts tool library are used for network visualization, including front-end display, back-end query, front-end and back-end interaction, which is used for click-to-view, search and multi-level expansion of the network knowledge graph.

5. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 4 is characterized in that: The electronic archives of the cultural resource sites include: basic information tables, current status photos, geographic coordinate information, protection boundaries, architectural surveying and mapping data, management data, and historical documents; The cultural resource labels include: name, protection category, classification level, city, county, type, approved batch, longitude and latitude coordinates, and age benchmark.

6. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 5 is characterized in that: Step S4 extracts the characteristics of historical and cultural resources in the following way: S4.

1. Use the Word2vec tool to put the text content of the historical and cultural resource knowledge graph into the algebraic space, perform word embedding, and use w as the current word placed in the vector space. t-1 、w t+1 Representing the words before and after w, forming an adjacency matrix in the vector space, forming a word vector matrix with a total size of V in the order of precedence; S4.

2. Using the connection relationship between knowledge graphs, we add the correlation dimension on the basis of the word vector matrix, perform spectral clustering on the word vector matrix, input V into the spectral clustering model N, and obtain the predicted classification. The formula is expressed as: In V×N ={in kt } Among them, w kt Refers to w in the kth clustering case t , represents the specific classification of the vocabulary after the word vector matrix V is placed into the spectral clustering model, {w kt } refers to w kt A collection of; S4.

3. Obtain the distribution of cultural characteristics through clustering analysis, summarize the correspondence between the characteristics displayed by the clustering and the geographic space mapping, and extract and output the cultural characteristics of the unsupervised knowledge graph.

7. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 6 is characterized in that: Step S5 constructs a historical and cultural model, the method is as follows: S5.

1. Build a cultural resource database, including: a cultural resource knowledge question and answer database, cultural resource text introductions and pictures, and a generative large model training data set; S5.2, RAG retrieval enhancement generation: Adopt the retrieval enhancement generation method, integrate the external knowledge base, directly access the latest information through the large language model, and generate retrieval-based output information; adopt the error correction retrieval enhancement generation method, including inputting questions, retrieving vector database documents, evaluating documents, re-retrieval, generating answers, and evaluating and enhancing the relevance of retrieved documents through evaluators and network searches.

8. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 7 is characterized in that: The cultural resource knowledge question and answer database described in step S5.1 is constructed using a vector database method, as follows: S5.1.

1. Perform word segmentation and word embedding on the nodes and edges of the knowledge graph of historical and cultural resources and convert them into vector form. The word segmentation adopts the default word segmenter of the GLM4 language model, and the word embedding adopts the Word2Vec method. The word segmentation is predicted based on context learning and the central word is mapped to a high-dimensional space vector while maintaining semantic similarity. S5.1.2, use the Faiss vector database for vector storage; S5.1.

3. Retrieve the database content through similarity search; use cosine similarity to measure the semantic similarity between the question sentence and the context sentence. The formula for calculating cosine similarity is: Among them, A·B represents the dot product of vector A and vector B, and ∥A∥∥B∥ represents the Euclidean norm of vector A and vector B respectively.

9. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 7 is characterized in that: In step S6, the language model dialogue framework includes: a natural language understanding module, a dialogue management module, a database query module, and a natural language generation module; The natural language understanding module uses the GLM4 generative language model to convert natural language text into structured data, including an intention judgment submodule and an entity slot filling submodule; The dialogue management module is used to coordinate and control the question-answering interaction process to ensure that user questions are correctly understood and effectively answered, including a dialogue state tracking submodule and a strategy selection submodule; The database query module retrieves information from the cultural resource knowledge database to answer user questions, including a database connection submodule and a data retrieval submodule; The natural language generation module converts the retrieved information or processed data into natural language text, organizes the extracted content using a predefined template or structure, and provides users with understanding and reading.

10. The method for mining and displaying cultural features based on knowledge graph and generative big model according to claim 9 is characterized in that: The intention judgment submodule understands the intention expressed by the user through natural language, including: input preprocessing, feature extraction, model training, and intention classification; The entity slot filling submodule extracts structured information from natural language text and represents it in the form of entities and corresponding slots. The entities are key information in the text, including names, places, and years; the slots are specific descriptions or attributes of these entities, including the location, age, and category of cultural resources. The dialogue state tracking submodule is used to track and update the user's intention, inquiry content and dialogue context information during the dialogue process, so as to help the system understand the progress of the dialogue and respond; The strategy selection submodule learns context information through a large language model, and selects rhetorical questions, confirmation questions, and answer questions according to the intent and entity slot filling status to determine the next action strategy; The database connection submodule connects to the database and uses a semantic similarity algorithm to query the data stored in the Faiss vector database; The data retrieval submodule executes the query to return the results, evaluates the returned results, and selects the query strategy.

Citation Information

Cited By

  • Historical and cultural oriented space classification and regeneration method and system

    CN120448874A

  • Historical building ontology modeling system oriented to generative artificial intelligence

    CN120541930A