Nlp-Based Queries: Using Embeddings and Generative Models For Complaint Analysis In Smart Cities
The growth of cities and the expansion of digital technologies have enabled the collection of vast amounts of data addressing environ- mental and social issues. When well-structured and analyzed, this data has the potential to transform urban services and enhance the manage- ment of smart cities. However, the lack of efficient technological tools in the public sector to interpret complex textual queries and provide formal responses limits the ability to address local demands and make evidence-based decisions from large databases. This study proposes an approach leveraging embeddings and generative models to transform tex- tual queries into vector representations, identify contextual patterns in SQL databases, and generate formal and contextually relevant responses. The solution was developed using tools such as Python, NumPy, and Pandas, alongside Google’s Generative Artificial Intelligence (GenAI) Gemini model. The steps included data extraction, embedding gener- ation, similarity calculation using a dot product, and the generation of formal responses based on contextual data. The research advances the application of Natural Language Processing (NLP) and generative arti- ficial intelligence in urban contexts, contributing to the development of novel approaches in Information Systems. It offers an innovative tool to optimize public administration, address citizen demands, and improve the efficiency of urban services.