Smart city management systems try to apply and utilize artificial intelligence (AI) technology to detect urban events such as traffic accidents occurring in urban environments through sensor data from the deployed Internet of Things (IoT) sensor data. However, there is a problem of lack of high-quality training data with meaningful label related to urban events. To solve the problem, this study proposes a method of labeling IoT sensor data accumulated in a smart city environment so that it can be used within machine learning models, which are necessary to detect urban events. More specifically, firstly, I develop AI technology to detect urban events more accurately from geographically fine-grained urban sensor data. Then, I compare urban events, which are collected via a administrative agency, with the detected anomalous sensor data points. Finally, I utilize labels extracted from social media messages left by many people in the smart city environment to attach meaningful labels such as traffic accidents, road emergency works to the detected urban events.