Construction method and system of historical and cultural knowledge graph of scenic spot, electronic equipment and medium

By constructing a historical and cultural knowledge map of scenic spots, collecting and processing historical and cultural data, and using the NMIBC recognition model for entity recognition and relationship extraction, the problem of lack of personalization and depth in the popularization of historical and cultural science in scenic spots is solved, and efficient information retrieval and cultural heritage are achieved.

CN119441502APending Publication Date: 2025-02-14SHANDONG LANGCHAO SMART CULTURAL TOURISM IND DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411361594.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The existing scenic spots have problems such as not targeted and lack of personalization and depth.

Method used

By constructing a historical and cultural knowledge map of scenic spots, collecting and processing structured, semi-structured and unstructured historical and cultural data information, using a pre-constructed NMIBC recognition model for entity recognition and relationship extraction, forming a triple data set, and importing Neoj4 builds a knowledge graph database.

Benefits of technology

It has achieved personalized and in-depth display of the historical and cultural heritage of the scenic spot, improved the efficiency of information retrieval, promoted cultural inheritance and education, optimized operation management, and solved the problems of physical disambiguation and relationship integration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441502A_ABST
    Figure CN119441502A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a construction method and system for a historical and cultural knowledge graph of a scenic area, electronic equipment and a medium, and belongs to the field of knowledge graph construction. The method comprises the following steps: collecting historical and cultural data information of a target scenic area; marking entities in the historical and cultural data information text, and performing entity recognition by adopting a pre-constructed NMIBC recognition model to obtain an entity recognition result; extracting an entity relationship, forming a triple data set containing entities and relationships in combination with an entity recognition result, performing similarity calculation, and performing relationship merging according to the similarity to obtain a target entity relationship; and importing the triple data set into Neoj4 to construct a knowledge graph database. By constructing the scenic region historical culture knowledge graph, the unique historical culture of the scenic region can be mined and inherited, a scenic region manager can use the knowledge graph to carry out digital, networked and intelligent management on travel resources, and the operation efficiency and decision support are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knowledge graph construction, and specifically to a method, system, electronic equipment and medium for constructing a historical and cultural knowledge graph of a scenic spot. Background Art

[0002] With the rapid development of big data, artificial intelligence, and semantic web technologies, the tourism industry is undergoing unprecedented transformation. These technologies provide strong support for deeply exploring and showcasing the rich historical and cultural heritage of scenic spots. Regarding the industry context, with tourists' growing demand for cultural tourism experiences, the traditional superficial tourism model is no longer able to meet market demand, and personalized, in-depth cultural tourism experiences are becoming a new trend. Therefore, constructing a historical and cultural knowledge graph for scenic spots has become a key measure to improve the quality of tourism services and enhance tourists' sense of cultural enrichment. On a technical level, advances in natural language processing (NLP) technology have made it possible to automatically extract historical and cultural information from massive amounts of multi-source data, including text, images, and videos. Graph databases and knowledge graph technologies have effectively solved the problems of structured information storage and efficient querying, enabling the systematic organization and intelligent reasoning of historical and cultural knowledge.

[0003] Therefore, constructing a historical and cultural knowledge map of scenic spots and integrating history and culture are the essential underlying foundations for the digital transformation of the cultural and tourism industry. In the future, personalized tour programs for tourists developed through historical and cultural knowledge maps can analyze tourists' interests, preferences, and historical behaviors, and intelligently recommend cultural attractions and activities that suit their preferences, thereby achieving precise marketing and personalized services and enhancing tourists' satisfaction and loyalty.

[0004] There are some problems with the current status of knowledge and cultural popularization in scenic spots, mainly in that the popularization is not very targeted, and the popularization language for all tourists is often the same, lacking in personalization and depth. Summary of the Invention

[0005] The purpose of the embodiments of the present invention is to provide a method, system, electronic device and medium for constructing a historical and cultural knowledge graph of a scenic spot, which is used to fully or at least partially solve the technical problems existing in the above-mentioned prior art.

[0006] To achieve the above objectives, an embodiment of the present invention provides a method for constructing a historical and cultural knowledge graph of a scenic spot, comprising: Collecting historical and cultural data information of the target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information; Entities in the historical and cultural data information text are marked and recognized using the pre-built NMIBC recognition model to obtain entity recognition results. The NMIBC recognition model includes the NEZHA layer, the MRS-IMVO-BiLSTM layer, and the CRF layer. Entity relationships are extracted and combined with entity recognition results to form a triple data set containing entities and relationships. Similarity is calculated for the triple data set, and relationships are merged based on the similarity to obtain the target entity relationship. Based on the target entity relationship, the triple dataset is imported into Neoj4 to build a knowledge graph database.

[0007] Optionally, collect historical and cultural data of the target scenic area, including: Use Python's Scrapy framework to crawl network data and collect historical and cultural data information of the target scenic spot; among them, structured historical and cultural data information at least includes the date, place, people and results of historical events, semi-structured historical and cultural data information at least includes historical document catalogs and abstracts, and time description texts of historical figures, and unstructured historical and cultural data information at least includes historical books and paper texts, text introductions of cultural heritage, folk legends and songs.

[0008] Optionally, entities in the historical and cultural data information text are marked and recognized using a pre-built NMIBC recognition model to obtain entity recognition results, including: Use the relative position encoding of the NEZHA layer to learn the transfer of information, where the NEZHA layer is a pre-trained model based on the Transformer architecture; The MRS-IMVO-BiLSTM layer extracts long-range semantic information and calculates the local optimal solution to avoid missing features of local contextual semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM base model. Use the CRF layer to perform global optimal tag sequence prediction to obtain entity recognition results.

[0009] Optionally, the process of extracting entity relationships includes: All characteristic data words in historical and cultural data are shuffled and annotated according to sentence features, part-of-speech features, entity categories, and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification; Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relational feature words, and represent them in the form of triples; Use stanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

[0010] Optionally, similarity is calculated for the triplet dataset according to the following formula:

[0011] Where, Represents the word vector corresponding to the first relation name, represents the mean of the word vector corresponding to the first relation name, and Y represents the word vector corresponding to the second relation name. Represents the mean of the word vectors corresponding to the second relation name.

[0012] On the other hand, the present invention also provides a system for constructing a historical and cultural knowledge map of a scenic spot, comprising: A collection unit, configured to collect historical and cultural data information of a target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information; The entity recognition unit is used to mark entities in the historical and cultural data information text and use the pre-built NMIBC recognition model to perform entity recognition and obtain entity recognition results. The NMIBC recognition model includes the NEZHA layer, the MRS-IMVO-BiLSTM layer, and the CRF layer; The merging unit is used to extract entity relationships, combine entity recognition results, form a triple data set containing entities and relationships, calculate similarity on the triple data set, merge relationships based on similarity, and obtain the target entity relationship; A construction unit is used to import the triple dataset into Neoj4 to construct a knowledge graph database based on the target entity relationship.

[0013] Optionally, the entity identification unit is specifically configured to: Use the relative position encoding of the NEZHA layer to learn the transfer of information, where the NEZHA layer is a pre-trained model based on the Transformer architecture; The MRS-IMVO-BiLSTM layer extracts long-range semantic information and calculates the local optimal solution to avoid missing features of local contextual semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM base model. Use the CRF layer to perform global optimal tag sequence prediction to obtain entity recognition results.

[0014] Optionally, the merging unit is specifically configured to: All characteristic data words in historical and cultural data are shuffled and annotated according to sentence features, part-of-speech features, entity categories, and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification; Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relational feature words, and represent them in the form of triples; Use stanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

[0015] On the other hand, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for constructing a historical and cultural knowledge graph of a scenic spot as described above are implemented.

[0016] On the other hand, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for constructing the historical and cultural knowledge graph of a scenic spot are implemented as described above.

[0017] The above technical solution, through the construction of a scenic area's historical and cultural knowledge graph, helps to explore and inherit the unique history and culture of the scenic area. Scenic area managers can use the knowledge graph to digitize, network, and intelligently manage cultural and tourism resources, improving operational efficiency and decision-making support. Furthermore, the structured nature of the knowledge graph enables multi-dimensional analysis of the scenic area's history and culture, providing researchers and decision-makers with a rich data perspective.

[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following detailed description, they are used to explain the embodiments of the present invention, but do not constitute a limitation of the embodiments of the present invention. In the accompanying drawings: Figure 1 This is a flowchart of an implementation method for constructing a historical and cultural knowledge graph of a scenic spot provided by an embodiment of the present invention; Figure 2 Schematic diagram of the structure of an NMIBC recognition model provided by an embodiment of the present invention; Figure 3 A Neo4j knowledge graph database provided by an embodiment of the present invention; Figure 4 It is a structural diagram of a system for constructing a historical and cultural knowledge graph of a scenic spot provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to better understand the technical solution of this application, the concept of knowledge graph is now introduced: A knowledge graph is a semantic network used to describe the relationships between entities. It transforms real-world information into a graph structure, where nodes represent entities (such as people, places, organizations, and products) and edges represent relationships between entities, thereby constructing a vast semantic network diagram. A knowledge graph is more than just a graphical knowledge base; it also contains semantic descriptions of entities and relationships that can be understood and processed by computers. The construction of a knowledge graph relies on a variety of technologies, including natural language processing, image recognition, and machine learning, to enable information extraction, integration, and reasoning.

[0021] The following describes the specific implementation of the embodiment of the present invention in detail with reference to the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the embodiment of the present invention and is not used to limit the embodiment of the present invention.

[0022] See Figure 1 As shown in FIG, a flowchart of a method for constructing a historical and cultural knowledge graph of a scenic spot provided by an embodiment of the present invention is provided, which includes the following execution steps: Step 100: Collect historical and cultural data information of the target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information.

[0023] Specifically, Python's Scrapy framework is used to crawl network data to collect historical and cultural data information of the target scenic spot; among them, structured historical and cultural data information at least includes the date, place, people and results of historical events, semi-structured historical and cultural data information at least includes historical document catalogs and abstracts, and time description texts of historical figures, and unstructured historical and cultural data information at least includes historical books and paper texts, text introductions of cultural heritage, folk legends and songs.

[0024] In some implementations, the construction of a knowledge graph requires massive amounts of data and knowledge to support it, and high-quality datasets are crucial for building a knowledge graph. Building a historical and cultural database for scenic spots aimed at digital tourism, encompassing textual data on history, humanities, folklore, literature, and other aspects, requires the collection of data from multiple sources, including structured and unstructured data from the internet, databases, and other sources. Data cleaning is performed to remove blank fields, duplicate fields, and overly long or short fields to ensure the credibility of the data entering the knowledge base. The Python-based Scrapy framework is used to crawl data from the internet, collecting relevant scenic spot data from various sources, including but not limited to history and culture, humanistic beliefs, folk customs, literary classics, geography and hydrology, artistic aesthetics, and architectural styles. The structured data captured includes databases of historical events, dates, locations, tasks, and results, databases of historical and cultural heritage information, and databases of biographies of historical figures. Semi-structured data includes historical document catalogs and abstracts, information on historical artifacts, and textual descriptions of historical figures. Unstructured data includes historical books and papers, textual introductions to cultural heritage, folk tales and ballads, and letters and paintings by historical figures.

[0025] Due to the inherent defects of web crawlers such as large data noise, the collected corpus texts also contain a large amount of unstructured information such as web page tags, special symbols and links. These data are cleaned and processed. First, the paragraphs are divided into sentences, and then redundant information, spaces and special symbols are removed to ensure the accuracy and consistency of the data and improve the data quality; a stop word list is set to remove irrelevant information interference.

[0026] Step 101: Mark the entities in the historical and cultural data information text, and use the pre-built NMIBC recognition model to perform entity recognition to obtain entity recognition results, where the NMIBC recognition model includes the NEZHA layer, the MRS-IMVO-BiLSTM layer, and the CRF layer.

[0027] Specifically, executing step 101 to mark entities in the historical and cultural data information text and using the pre-built NMIBC recognition model to perform entity recognition to obtain entity recognition results includes the following execution steps: S1010: Use the relative position encoding of the NEZHA layer to learn the transfer of information, where the NEZHA layer is a pre-trained model based on the Transformer architecture.

[0028] S1011: Use the MRS-IMVO-BiLSTM layer to extract long-distance semantic information and calculate the local optimal solution to avoid feature loss of local context semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM base model.

[0029] S1012: Use the CRF layer to predict the global optimal tag sequence and obtain entity recognition results.

[0030] In defining the data model, this application divides the data entities in the historical and cultural data map of the scenic spot into six types: people (PER), places (LOC), events (EVENT), time (TIME), organizations (ORG), and works (WORK).

[0031] In some embodiments, since the data crawled from the web contains data in various structural forms, for structured information, D2R technology is directly used to convert it into RDF triple information. For semi-structured and unstructured data, because the amount of data is too large, BERT is selected to efficiently annotate the data set. The main research objects are attributes, including but not limited to relationships between people and tasks, people and time, people and time, people and organizations, people and works, places and time, places and time, places and events, places and organizations, places and works. In order to correctly identify the relationships between different entities, the entities are divided into the following six categories for annotation. First, select a sample with strong representativeness and wide coverage for manual annotation, and use the BIOES annotation system to annotate the text. The annotations of each entity are shown in Table 1 below: Table 1 Entity annotation

[0032] BERT models are pre-trained using manually annotated datasets, with parameter fine-tuning, loss functions and optimizers defined, and iterative training data. Using manually annotated data, supervised learning of the BERT model allows the model to better understand and perform entity recognition and relation extraction tasks. Furthermore, manual calibration of the datasets processed by the model is performed to correct obvious model errors and address model errors.

[0033] Step 102: Extract entity relationships, combine entity recognition results, form a triple data set containing entities and relationships, calculate similarity on the triple data set, merge relationships based on similarity, and obtain target entity relationships.

[0034] It should be understood that there are five types of relationships between entities: <birth>, <creation>, <participation>, <occurrence>, and <belongs to>.

[0035] In some implementations, the process of extracting entity relationships in step 102 includes: S1020: All characteristic data words in the historical and cultural data information are shuffled and annotated according to sentence features, part-of-speech features, entity categories and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification.

[0036] S1021: Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relationship feature words that are associated, and express them in the form of triples.

[0037] S1022: Use StanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

[0038] In some embodiments, similarity is calculated for a triplet dataset according to the following formula:

[0039] Where, Represents the word vector corresponding to the first relation name, represents the mean of the word vector corresponding to the first relation name, and Y represents the word vector corresponding to the second relation name. Represents the mean of the word vectors corresponding to the second relation name.

[0040] In some embodiments, NMILC entity recognition and extraction includes: Since Chinese named entity recognition has always been challenged by low word segmentation accuracy, incorrect word segmentation may lead to entity boundary recognition errors. To solve this problem, a five-layer model NMIBC (NEZHA-MRS-IMVO-BiLSTM-CRF) Chinese named entity recognition model based on the BERT model is used. Its structure is shown in Figure 2 As shown, entity recognition is performed. The NEZHA model is first used. Building on the BERT model, the NEZHA model adds relative position encoding, using characters as the smallest unit, to better learn information transmission. It then uses MRS-IMVO-BiLSTM (mean absolute error random sampling with an improved multiverse optimization algorithm and bidirectional long short-term memory network) to extract long-range semantic information, calculate local optimal solutions, and avoid missing features of local contextual semantics. Finally, a CRF (conditional random field) is used to enforce legitimacy constraints on the probability of incorrect label output. This results in a final recognition model, improving the accuracy of Chinese named entity model recognition. The model consists of three layers: the NEZHA layer, the MRS-IMVO-BiLSTM layer, and the CRF layer. The NEZHA model is a pre-trained model based on the Transformer architecture, making it more suitable for full-word masking in Chinese. It also uses mixed-precision training and LAMB (layer-wise adaptive time optimizer for batch training) to improve training efficiency.

[0041] The MRS-IMVO-BiLSTM layer uses the LSTM model for training, which can overcome the gradient explosion or vanishing problems that are common in RNNs during long sequence training. By concatenating vectors to the final hidden layer representation, the resulting concatenation of contextual features in two directions can better understand bidirectional semantic relationships and avoid the problem of missing local feature semantics.

[0042] At the same time, considering that the construction of the cultural and tourism knowledge graph involves a huge amount of text, the semantic complexity in the Chinese context is increased, and there are complex problems of multiple local optimal solutions in text processing, the BiLSTM model is improved by using an improved multiverse algorithm based on random sampling of mean absolute error. The multiverse optimization algorithm is improved in order to provide effective search in the solution space and improve the efficiency of text extraction.

[0043] Like other algorithms, the IMVO algorithm performs a global search followed by a local search when searching for the current optimal universe. To improve the algorithm's search capabilities, an adaptive compression factor is introduced to change the position of the current optimal universe. When other universes are far away from the current optimal universe, the compression factor increases, accelerating the algorithm's convergence speed. When other universes are close to the current optimal universe, the compression factor decreases, forcing the algorithm to perform a more precise search. The MRS-IMVO algorithm uses mean absolute error random sampling to evaluate performance when searching for the optimal LSTM hyperparameters. This allows for comparison of different candidate structures without training, significantly reducing the time required to find the optimal hyperparameters. The steps are as follows: Step 1: Parameter Setup. Determine the swarm size, number of iterations, WEPmax and WEPmin, the mining coefficient p, and the number and threshold of error sampling. (The WEP value represents the probability of wormholes in the MVO.)

[0044] Step 2: Define the evaluation function.

[0045] Step 3: Calculate the expansion rate of the individual universe.

[0046] Step 4: Introduce the spiral update mechanism to enhance the global search capability of the algorithm and prevent the algorithm from converging to the local optimum too early.

[0047] Step 5: Sort the universe according to the expansion rate and perform normalization, then update the position of the universe through the white hole / black hole model.

[0048] Step 6: Introducing an adaptive compression factor for cultural and tourism knowledge , λ is the adaptive compression factor, is the current iteration number, is the maximum number of iterations, is the local optimal value marked in the current universe. The position of the optimal universe is dynamically adjusted to balance global search and local search.

[0049] Step 7: Determine the WEP (wormhole existence rate) and TDR (travel distance rate) under the current number of iterations, and then update the cosmic position through the wormhole model.

[0050] Step 8: Calculate the updated expansion rate of the universe, update the position of the optimal universe and save it.

[0051] Step 9: Output the global optimal solution after reaching the maximum number of iterations, otherwise return to Step 5 to continue execution.

[0052] Step 10: Assign the hyperparameter combination represented by the global optimal solution to the corresponding LSTM network, further train the weight parameters through the gradient optimization algorithm, and finally output the prediction result of the current data set.

[0053] The LSTM works by extracting valuable information from the cell state and forgetting some worthless information, thereby achieving effective information transmission. It also outputs the hidden state at each time step. The forget gate, memory gate, and output gate, derived from the previous hidden state and the current input, regulate forgetting, memory, and output. The calculation formula for each state is:

[0054] in: For the Gate of Forgetfulness, For the memory gate, is a temporary cell state, is the cell state at the current moment, is the output gate, is the hidden layer state, is the hidden state of the previous moment, W is the weight matrix, is the input word at the current moment, and b is the bias vector.

[0055] The CRF layer predicts the training set results of the NEZHA layer and the MRS-MVO-BiLSTM layer, uses the linear chain conditional random field to obtain the optimal tag sequence under global conditions, and generates a CRF-based sequence tagging model for entity relationship recognition.

[0056] For each training sample X, find the scores S(X, y) of all possible sequence annotations, and then normalize all scores.

[0057] Where: The i-th position of the softmax output is The probability of For arrive Since not all labels corresponding to the maximum probability value are output by softmax, when a predicted label score is very high, it is also necessary to consider whether the sum of the transition probabilities is the maximum to avoid outputting the wrong label. is the correct label sequence, and taking the logarithm we can get The maximum probability among all sequences:

[0058] The goal of optimization is to maximize the formula (that is, the maximum probability value corresponding to the true label). After training, when making predictions, the S scores corresponding to all possible y sequences are calculated to obtain the best prediction results. , the resulting label sequence is The triple of is considered to be the RDF triple of the word.

[0059]

[0060] After entity relationship extraction, a CRF-based sequence labeling model is obtained, and the syntactic analysis tree is used to identify relationship feature words to distinguish the entity pairs in the data that are most likely to form RDF triples. By analyzing the syntactic structure, it is possible to determine which words in the sentence are closely related to the relationship between entities, help identify possible entities and corresponding relationships, and prepare for the next step of entity relationship extraction.

[0061] In some embodiments, the entity relationship extraction process includes: extracting entity relationships after entity recognition, and the relationships between entities in the current database include: birth, creation, participation, occurrence, and belonging. Since the corpus of the historical and cultural map is long and the text triples are clear, the entity relationship extraction method of CRF and syntactic analysis tree is used to extract entity relationships. All feature data words are shuffled and annotated according to the order of four different levels (sentence features, part-of-speech features, entity categories, and word boundary features) and the CRF sequence model, and then a specific manual annotation method is combined to form a specific training set. The set is placed in the CRF sequence model for multi-level verification to obtain a large number of subsets with relationship features, and the role of each word in the sentence is analyzed in the structural form of a syntactic analysis tree to identify the most likely combination of triple entities and relationship feature words, which are expressed in the form of triples. Stanford Parser is used to complete the dependency structure analysis of the sentence to form an analysis tree.

[0062] In some embodiments, after knowledge extraction, multi-dimensional and heterogeneous historical and cultural data of scenic spots form a triple data set containing entities and relationships, but some entities and relationships still have problems of expression redundancy and semantic ambiguity. Since the entity disambiguation problem involved in the historical and cultural knowledge base is complex and highly domain-specific, it cannot be integrated through conventional algorithms. To solve this problem, an artificially constructed custom dictionary is used to complete entity fusion. In response to the ambiguity problem between relationships, the Pearson similarity coefficient is selected in combination with the Harbin Institute of Technology Synonymous Dictionary (extended version) to calculate the similarity of the relationship names. First, the relationship name is converted into a word vector, and the similarity value P (x, y) between the vectors is calculated using the Pearson similarity coefficient formula:

[0063] The value of P ranges from [-1, 1]. If it exceeds 0.8, it means that x and y are strongly correlated. It can be considered that the two relationship names belong to the same relationship and the relationships can be merged. Otherwise, x and y do not belong to the same relationship.

[0064] Step 103: Based on the target entity relationship, the triple dataset is imported into Neoj4 to construct a knowledge graph database.

[0065] Specifically, based on the relationship between entities, the entity triples are imported into Neoj4 for storage and a knowledge graph database based on Neo4j is constructed (see Figure 3 Neo4j's primary query language is Cypher, a declarative language based on graph models. The identified entity and relationship sets are converted to CSV format and imported into the graph database using Cypher to build and store the knowledge graph.

[0066] The technical effects achieved by this application are as follows: 1. Improve information retrieval efficiency: By constructing a historical and cultural knowledge graph of scenic spots, unstructured data is converted into structured knowledge representation, which greatly improves the retrieval efficiency and accuracy of historical and cultural information, laying a data foundation for the subsequent construction of scenic spot historical and cultural intelligent question-and-answer system and scenic spot cultural retrieval system.

[0067] 2. Promote cultural inheritance and education: The construction of knowledge graphs helps to explore and inherit the unique history and culture of scenic spots, provides rich resources for education and research, and promotes the protection and dissemination of cultural heritage.

[0068] 3. Optimize operational management: Scenic area managers can use knowledge graphs to digitize, network, and intelligently manage cultural and tourism resources to improve operational efficiency and decision-making support.

[0069] 5. Solve the problems of entity disambiguation and relationship fusion: By manually constructing a custom dictionary and using the Pearson similarity coefficient to calculate the similarity of relationship names, the problems of entity disambiguation and relationship fusion are effectively solved.

[0070] 6. Build a dynamically updated knowledge base: The knowledge graph database supports dynamic updates, promptly reflecting the latest research findings on history and culture and the latest demands of the tourism market. Through continuous maintenance and updates, the recognition accuracy and content of the knowledge graph will be improved, thereby enhancing its universality.

[0071] 7. Support multi-dimensional data analysis: The structured characteristics of the knowledge graph make multi-dimensional analysis of the history and culture of the scenic area possible, providing researchers and decision makers with a rich data perspective.

[0072] See Figure 4 FIG. 1 is a schematic diagram of a system for constructing a historical and cultural knowledge graph of a scenic spot provided by an embodiment of the present invention, including: The collection unit 40 is used to collect historical and cultural data information of the target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information; An entity recognition unit 41 is used to mark entities in the historical and cultural data information text and use a pre-built NMIBC recognition model to perform entity recognition to obtain entity recognition results, wherein the NMIBC recognition model includes a NEZHA layer, an MRS-IMVO-BiLSTM layer, and a CRF layer; A merging unit 42 is used to extract entity relationships, combine entity recognition results, form a triple data set containing entities and relationships, calculate similarity on the triple data set, merge relationships based on similarity, and obtain target entity relationships; The construction unit 43 is used to import the triple dataset into Neoj4 to construct a knowledge graph database based on the target entity relationship.

[0073] In some embodiments, the entity identification unit 41 is specifically configured to: Use the relative position encoding of the NEZHA layer to learn the transfer of information, where the NEZHA layer is a pre-trained model based on the Transformer architecture; The MRS-IMVO-BiLSTM layer extracts long-range semantic information and calculates the local optimal solution to avoid missing features of local contextual semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM base model. Use the CRF layer to perform global optimal tag sequence prediction to obtain entity recognition results.

[0074] In some implementations, the merging unit 42 is specifically configured to: All characteristic data words in historical and cultural data are shuffled and annotated according to sentence features, part-of-speech features, entity categories, and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification; Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relational feature words, and represent them in the form of triples; Use stanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

[0075] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps of the method for constructing a historical and cultural knowledge graph of a scenic spot as described in any one of the above embodiments.

[0076] On the other hand, the present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for constructing a historical and cultural knowledge graph of a scenic spot described in any of the above embodiments are implemented.

[0077] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0079] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0081] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0082] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0083] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology to store information. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0084] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0085] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims

1. A method for constructing a historical and cultural knowledge graph of a scenic spot, characterized in that: include: Collecting historical and cultural data information of the target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information; The entities in the historical and cultural data information text are marked, and the pre-built NMIBC recognition model is used for entity recognition to obtain entity recognition results. The NMIBC recognition model includes the NEZHA layer, the MRS-IMVO-BiLSTM layer, and the CRF layer. Entity relationships are extracted and combined with entity recognition results to form a triple data set containing entities and relationships. Similarity is calculated for the triple data set, and relationships are merged based on similarity to obtain the target entity relationship. Based on the target entity relationship, the triple data set is imported into Neoj4 to build a knowledge graph database.

2. The method for constructing a scenic spot historical and cultural knowledge map according to claim 1 is characterized in that: Collect historical and cultural data information of the target scenic spot, including: Use Python's Scrapy framework to crawl network data and collect historical and cultural data information of the target scenic spot; among them, structured historical and cultural data information at least includes the date, place, people and results of historical events, semi-structured historical and cultural data information at least includes historical document catalogs and abstracts, and historical figures' time description texts; unstructured historical and cultural data information at least includes historical books and paper texts, text introductions of cultural heritage, folk legends and songs.

3. The method for constructing a scenic spot historical and cultural knowledge map according to claim 1 is characterized in that: The entities in the historical and cultural data information text are marked, and the pre-built NMIBC recognition model is used for entity recognition to obtain entity recognition results, including: Use the relative position encoding of the NEZHA layer to learn the transfer of information. The NEZHA layer is a pre-trained model based on the Transformer architecture. The MRS-IMVO-BiLSTM layer is used to extract long-distance semantic information and calculate the local optimal solution to avoid the feature loss of local context semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM basic model. The CRF layer is used to perform global optimal tag sequence prediction and obtain entity recognition results.

4. The method for constructing a scenic spot historical and cultural knowledge graph according to claim 1 is characterized in that: The process of extracting entity relationships includes: All characteristic data words in the historical and cultural data information are shuffled and annotated according to sentence features, part-of-speech features, entity categories, and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification; Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relational feature words, and express them in the form of triples; Use stanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

5. The method for constructing a scenic spot historical and cultural knowledge graph according to claim 1 is characterized in that: The similarity of the triple dataset is calculated according to the following formula: ; In the formula, Represents the word vector corresponding to the first relation name, represents the mean of the word vectors corresponding to the first relation name, and Y represents the word vectors corresponding to the second relation name. Represents the mean of the word vectors corresponding to the second relation name.

6. A system for constructing a historical and cultural knowledge graph of a scenic spot, characterized in that: include: A collection unit, used to collect historical and cultural data information of a target scenic spot, wherein the historical and cultural data information includes structured historical and cultural data information, semi-structured historical and cultural data information, and unstructured historical and cultural data information; An entity recognition unit is used to mark entities in the historical and cultural data information text, and use the pre-built NMIBC recognition model to perform entity recognition to obtain entity recognition results, wherein the NMIBC recognition model includes a NEZHA layer, an MRS-IMVO-BiLSTM layer, and a CRF layer; The merging unit is used to extract entity relationships, combine entity recognition results, form a triple data set containing entities and relationships, calculate similarity of the triple data set, merge relationships based on similarity, and obtain target entity relationships; A construction unit is used to import the triple data set into Neoj4 to construct a knowledge graph database based on the target entity relationship.

7. The system for constructing a scenic spot historical and cultural knowledge graph according to claim 6 is characterized in that: The entity recognition unit is specifically used for: Use the relative position encoding of the NEZHA layer to learn the transfer of information. The NEZHA layer is a pre-trained model based on the Transformer architecture. The MRS-IMVO-BiLSTM layer is used to extract long-distance semantic information and calculate the local optimal solution to avoid the feature loss of local context semantics. The MRS-IMVO-BiLSTM layer is an improved multiverse optimization algorithm that performs mean absolute error random sampling on the BiLSTM basic model. The CRF layer is used to perform global optimal tag sequence prediction and obtain entity recognition results.

8. The system for constructing a scenic spot historical and cultural knowledge graph according to claim 6 is characterized in that: The merging unit is specifically used for: All characteristic data words in the historical and cultural data information are shuffled and annotated according to sentence features, part-of-speech features, entity categories, and word boundary features, and combined with manual annotation methods to form a target training set for multi-level verification; Analyze the role of each word in the sentence in the form of a syntactic analysis tree, identify the combination of triple entities and relational feature words, and express them in the form of triples; Use stanfordParser to complete the dependency structure analysis of the sentence and form a parse tree.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for constructing a scenic spot historical and cultural knowledge graph as described in any one of claims 1-5 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for constructing a scenic spot historical and cultural knowledge graph as described in any one of claims 1 to 5 are implemented.