| With the development of industrialization and the improvement of people’s living standards,protecting and inheriting historical and cultural heritage have become an increasingly important topic.Since 2005,over 200 historical and cultural famous towns and villages have been lost each year.Currently,researches on historical and cultural famous towns and villages focus mainly on village spatial form and geography,while there are few researches on the digitalization of famous towns and villages and little work on the inheritance of folk culture.To promote the digitalization of historical and cultural famous towns and villages,as well as to address the issues of low relevance and query efficiency of related knowledge,this study proposes the application of knowledge graph technology to the field of historical and cultural famous towns and villages in Anhui Province.Using of the Bert-BiLSTM-CRF model with the adversarial training as the named entity recognition model,this paper performs entity recognition on unstructured text related to historical and cultural famous towns and villages in Anhui Province and matches the extracted entities to corresponding relationships.By combining the extracted and matched triples with Py2 neo and Cypher statements,we achieved the automatic construction of the knowledge graph of historical and cultural famous towns and villages in Anhui Province.The research work carried out in this dissertation is as follows:1.Based on the Bert-BiLSTM-CRF model,this study performs entity extraction on text.Firstly,the Bert layer is used to convert the text into word vectors,which can obtain more rich semantic feature information.Secondly,feature extraction is performed through the BiLSTM model.BiLSTM can combine the semantic features of the context when performing feature extraction and solve the problem of long-term forgetting that occurs during feature extraction of text data to some extent.Finally,the CRF layer is used to classify the temporal data.As CRF can combine transition matrices to classify sequences in sequence labeling tasks,it can improve the classification performance of the model to some extent.Based on the Bert-BiLSTM-CRF model,this study proposed an adversarial training method to add adversarial examples to the original data and train the model by minimizing the model’s loss value as the objective.This method improves the model’s generalization ability on the basis of improving the accuracy of entity recognition.After experimental comparison,it was found that the model trained with adversarial training had higher precision,recall,and F1 scores than the model without adversarial training,indicating that the former has stronger classification ability.2.The trained adversarial training-based Bert-BiLSTM-CRF model is used to perform entity extraction on unstructured text containing multiple entities.The extracted entity dataset is matched with a relationship dictionary to obtain the triple dataset required to build the knowledge graph.Use a Python program to read entity information and relationship information from triplets and save them to a list.Connect to the Neo4 j graph database using Py2 neo and pass the entity and relationship information read by Python into Py2neo’s automatic construction program to create nodes and relationships in batches,thereby achieving the automated construction of the knowledge graph of historical and cultural famous towns and villages in Anhui Province.3.On the basis of the constructed knowledge graph of historical and cultural towns and villages in Anhui Province,the knowledge graph is applied to an intelligent question-answering system.Firstly,the Bert-BiLSTM-CRF model is used to perform entity recognition on user input sentences,and obtain entity information.Secondly,the input question is converted into a vector by Bert,and PCA is used to reduce the dimensionality of the sentence vector.The cosine similarity between the user input sentence vector and the sentence vector of the template is calculated.The classification of the question is achieved by matching the similarity calculation results with the corresponding relationship in the template.The obtained entity information and sentence classification results are combined with Py2 neo and Cypher statements to query the knowledge graph and return the desired information to the user.In addition,the knowledge graph of historical and cultural towns and villages in Anhui Province is combined with Baidu Maps.The location information returned by the Cypher statement is matched with the BD09(Baidu map query special coordinates)coordinates,and the coordinate information is passed to the Baidu Maps API to display the location of the towns,villages,and surrounding scenic spots on the map.Figure[49] Table[17] Reference[62]... |