The commentary script. of tourist attractions serves as a crucial medium for the exchange of tourism knowledge and collaborative reasoning. This paper addresses the issue of declining tourist satisfaction due to the weakening of content information, the fading of knowledge transfer, and the reduction of logical reasoning in the actual tourism information interaction scenarios of tourist attraction commentary scripts. By crawling, retrieving, and compiling the textual data of commentary scripts from 139 national Agrade tourist attractions in the Ningxia Hui Autonomous Region, and utilizing Natural Language Processing ( NLP) technology, structured data comprising entities (such as scenic spots, Fig. s, and events) and relationships ( such as “located in, ” “belongs to, ” “occurred in”) is formed. The w3 software' s machine learning algorithm is employed to train a logical reasoning model, enabling entity recognition, relationship extraction, logical reasoning, and text generation, thereby establishing a knowledge graph library of scenic area commentary scripts at the provincial scale. Relying on the knowledge representation and extraction of the descriptive logic of commentary scripts, a general framework and method for optimizing commentary script. reasoning are proposed to enhance the total content, knowledge richness, and logical quality of scenic area commentary scripts. Through the standardization and intellectualization of the content supply of commentary scripts, the overall high-quality supply capacity of tourist attractions is promoted.