# Analysing Social Media Discourse on Electric Vehicles with Machine Learning
## 3 Materials and Methods
### Dataset  
In this study, data were collected from the social media platform X (formerly Twitter) to examine public perception towards EVs. The main reason for choosing the X platform is that it has a large and diverse user base who can freely share their opinions on current events and technologies. In addition, the X platform provides an environment conducive to analysing social trends and debates due to its real-time and dynamic data flow [34]. The dataset used in the study was created from tweets posted within the last month through the X API. The one-month data collection period was specifically chosen to reflect the current and dynamic public perceptions about EVs. During this period, the tweets about EVs constituted a representative sample to better analyse the current views and trends of society.  
The collected dataset consists of 6000 English and 891 Turkish tweets. In the data analysis process, unnecessary characters, duplicate data, and meaningless expressions were removed in the text preprocessing stage; in addition, only the content that provided semantic integrity was used in the analysis. As a result of the cleaning process, the number of English tweets decreased to 5370, and the number of Turkish tweets decreased to 858. The resulting dataset was used in the sentiment analysis and topic modelling stages, contributing to the determination of public perception of EVs.  
The final dataset used in the study consisted of 5370 English and 858 Turkish tweets after preprocessing. While this dataset provides a rich and diverse source of user opinions, it may also carry potential biases. For instance, certain demographic groups (e.g., younger, tech-savvy users) may be over-represented on social media platforms like X. Additionally, users expressing strong opinions are more likely to post about EVs, possibly skewing the dataset toward more polarised views. These limitations were considered during analysis and interpretation.  
The sample dataset is shown in Table 1.  
\begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt}} \hline \hline
**Tweet** & **Language** \\ \hline Fully EVs are impractical for most people and will be replaced by some form of hybrid technology in the not-too-distant future. & Tr \\ \hline Don’t buy an electric car, it explodes in an accident & Tr \\ \hline I have a question for electric vehicle owners, let’s say the charging time is 1 h or there is a queue, isn’t that annoying? & Tr \\ \hline If you want more EVs to be sold, you need to increase the penalties and sanctions against friends who park in front of charging stations. Otherwise, many people will not invest in EVs in this way. A scenario where charging is a problem would scare everyone. & Tr \\ \hline The electric car market is moving very fast, although it is stressful, slowly everyone is looking hot & Tr \\ \hline Visited China last year. Their electric car offerings are better, from a local perspective. More of the features they care about, significantly cheaper, better compatibility with charging stations, etc. & En \\ \hline Electricity much cheaper than gasoline. Thanks for making electricity cheaper. It makes driving an electric car even better now! & En \\ \hline Shifting gears from speed to sustainability, the high-performance sports car is giving way to eco-friendly EVs that accelerate the future of transport & En \\ \hline BYD is growing fast here cuz oil prices are too expensive & En \\ \hline Those electric cars are extremely dangerous due to the battery! I would never buy an electric car! & En \\ \hline \hline \end{tabular}
\end{table}
Table 1: Sample dataset.