# The Detection of Fake News in Arabic Tweets Using Deep Learning
## 3 Methodology
### Tweet Collection  
Twitter allows researchers, developers, and businesses to take advantage of its massive data repository through Twitter API [23]. Collecting data, monitoring customer satisfaction, controlling business account, evolving interaction experience, etc., all becomes easy with Twitter API. Twitter has several endpoints for collecting data from Twitter's platform. Recently, it released a new endpoint for academic research to facilitate the study of recurring concerns in the research community. It grants access to the full archive of all historic Tweets with more features that support collecting more unbiased, precise, and complete datasets. Whereas other Twitter endpoints can retrieve Tweets for the last seven days only. Tweets carrying false news were compared to true news Tweets. In this work, we strive to build a dataset containing news on a variety of topics (politics, sports, health, etc.). In addition, we need to gather as many fake news Tweets as possible. Therefore, the full archive search endpoint may be the best choice in order to obtain the right data. We followed the following steps to gain access to the full archive search endpoint. Initially, we applied for a developer account for the academic research track. After the developer account had been reviewed and approved, we generated an application inside the account that specified goals and some description of our project. Once the application creation is completed, the platform then returns the access keys and bearer token that will use one of these to connect to Twitter API and retrieve Tweets. To specify what Tweets we are looking for, we prepared a list of news, whether real or fake. For Tweets of fake news, we extracted a list of keywords relevant to the fake news from fact-checking websites, such as Anti-Rumors Authority ([[http://norumors.net/](http://norumors.net/)]([http://norumors.net/](http://norumors.net/)) accessed on 12 February 2022) and Misbar ([[https://misbar.com/](https://misbar.com/)]([https://misbar.com/](https://misbar.com/)) accessed on 25 February 2022), which examine the truthfulness of news stories propagated on social networks based on human  
Figure 1: The architecture of the proposed methodology. experts and then made publicly available. For Tweets of real news, we relied on many credible Twitter accounts to retrieve real news, such as Al-Riyadh ([[https://www.alriyadh.com/accessed](https://www.alriyadh.com/accessed)]([https://www.alriyadh.com/accessed](https://www.alriyadh.com/accessed)) on 18 March 2022) and Al-Ekhbariya ([[https://www.alekhbariya.net](https://www.alekhbariya.net)]([https://www.alekhbariya.net](https://www.alekhbariya.net)) accessed on 21 March 2022). After this, we sent a GET request written in Python to Twitter API to retrieve Tweets. The URL of a GET request usually carries three values, an authorization header that involves the bearer token, the endpoint's URL, and the query parameters. The query parameters are used to filter the Tweets based on the study case and limit irrelevant Tweets. An example of this is retrieving Tweets that contain a certain keyword. The academic search endpoint is accessed through Twitter API v.2.0. It just delivers the ID and text field of a Tweet, and all other fields need to be requested through query parameters, in contrast to API v.1.0, which delivers all other Tweet fields automatically. If the request is successful, the response retrieved from the Twitter API is returned in JSON (JavaScript Object Notation) format. The JSON response is broken down into separate columns, and the results are saved in the CSV format. The retrieved Tweets were filtered as follows: Tweets removed with fewer than three Arabic words; Retweets are discarded from a given Tweet; removal of irrelevant Tweets, duplicated Tweets, and Tweets that contained truth clarification for specific fake news. We ended up with a total of 5000 Tweets after the filtering step, of which 4000 were real news Tweets and 1000 were fake news Tweets. A sample of some collected Tweets is shown in Table 2.