The advent of social networks has brought about a paradigm shift in the conventional modes of social interaction and information exchange. Consequently, there is an increasing scholarly interest in the precise detection of communities and analysis of network structures. However, most of the prevailing methods for community detection suffer from limitations in accuracy and efficiency due to the requirement of manually configuring attribute vector dimensions during the extraction of attribute information. Moreover, these algorithms often neglect the pervasive influence of users within the global network and their capacity to disseminate information, thereby undermining the accuracy of community detection. To address these challenges, this study proposes a novel community detection algorithm, named HL Louvain, which draws upon the Hypertext Induced Topic Search (HITS) technique. The HL Louvain algorithm initially applies graph compression to the entire network and subsequently leverages the HITS algorithm to extract global node characteristics. By combining semantic attribute information with local user features, the algorithm defines the collective influence of users. This, in turn, facilitates accurate community detection by modifying the iterative approach of the conventional Louvain algorithm. Furthermore, the algorithm significantly enhances accuracy and stability by autonomously optimizing the iterative process to determine the dimensionality of the attribute vector and the number of topics within the identified network. Experimental evaluations conducted on three distinct Twitter datasets with varying degrees of complexity, as well as a public dataset, demonstrate that the HL Louvain algorithm outperforms other state-of-the-art algorithms in terms of accuracy and stability.