ASAD : A rabic Social media Analytics and un D erstanding (2021)

Abstract: This system demonstration paper describes ASAD: Arabic Social media Analysis and unDerstanding, a suite of seven individual modules that allows users to determine dialects, sentiment, news category, offensiveness, hate speech, adult content, and spam in Arabic tweets. The suite is made available through a web API and a web interface where users can enter text or upload files.

## introduction since arabic is spoken across a vast region, the arabic twittersphere presents a valuable scope into social and linguistic phenomena, such as the multitude of dialects being used across different regions. the arabic social media and understanding (asad) suite foot_1 , which we present herein, offers valuable tools for exploring such phenomena and for the automated processing of arabic social media texts. specifically, asad offers dialect identification, sentiment analysis, news category detection, offensive language detection, including hate speech and vulgar language, and spam detection. these tools are valuable for many downstream nlp application. for example, dialect identification can help improve author profiling and machine translation @xcite . sentiment analysis can aid in quantifying public opinions @xcite . detecting news categories can aid in content analysis. further, offensive language and spam detection can help identify potentially malicious content on social media. although there has been a growing interest in analyzing arabic social media, there is a deficiency in publicly available tools or such tools are not integrated into one framework or toolkit. for example, we are not aware of any publicly available systems for offensive language, hate speech, adult content, or spam. similarly, adida @xcite and camel @xcite ) dialect identification systems were not trained with twitter data. thus, asad fills an important gap in the arabic social media analysis space. for ease of use, we make asad available via an i) online interface where users can enter text or upload files, and ii) web apis that accept post requests, making asad accessible from any programming language. during the development of asad, we weighed different trade-off between effectiveness and efficiency to achieve competitive results at low computational costs. thus, asad utilizes support vector machine (svm) classification for six out of the seven modules. as we show later, with the exception of dialect identification, we achieve results that are comparable or slightly lower than deep neural network models (dnn), namely fine-tuned bert, while being significantly more efficient with no need for gpus. due to a larger difference in performance, we deploy a fine-tuned bert model for dialect identification only. we hope that asad will aid researchers, analysts, and system integrators in incorporating arabic social media analytics and understanding into their models and applications. we also hope that asad will motivate researchers to build similar suites for other languages. ## related work analysis of arabic social media has gained much recent interest. offensive language and hate speech detection have yielded datasets, shared tasks @xcite , and strong systems based on machine learning and contextual embedding models @xcite . sentiment analysis is a well addressed problem yielding datasets @xcite and systems based on and deep learning techniques @xcite among others. finetuned bert models have been used for identifying categories of news posts on social media @xcite . adult content and spam detection have been relatively less explored with the focus mainly on creating resources @xcite @xcite @xcite . dialect id has been the focus of the madar project @xcite and other works @xcite @xcite . despite the abundance of literature in the aforementioned topics, there has been very little effort toward making tools available for public use. most of the tools available in arabic nlp tasks concentrate on nlp tasks such as segmentation, parsing, lemmatization, and pos tagging @xcite @xcite . along with text processing tools, camel tools @xcite ) allows sentiment analysis and dialect id via a python package. adida @xcite is a web interface for dialect id. the dialect id systems of camel tools and adida are based a parallel corpus of 25 arabic city dialects in the travel domain. ## classification models some state-of-the-art (sota) techniques use complex models, typically dnn models, to achieve the best results. for asad, we want to have models that are small in size and easy to deploy while providing good results. to this end, we compare performances of fine-tuned bert models and svms with character n-gram vectors weighted by term frequency-inverse document frequency (tf-idf) as features. as we show, the svm models we employ are competitive with sota dnn models for majority of the modules of asad. the range of n-gram can influence the size of models and their performance. for each component in our suite, we experimented with different ranges of n-gram and calculated model size along with respective performance. the user can select any of the modules from the tabs and test the performance on random samples and classify them to easily understand the different modules. the user can type a text to be classified. the classification results appear in a table so that earlier results can be referred to. we recognize that users may want to classify many tweets in one go without having to type them one at a time. to allow this, the users can upload a text file. each line is classified by our system and users can download a file that contains predicted class and class probabilities. to prevent excessive usage, we limit allowed files to have at most 100 lines. we also use google recaptcha v2 foot_6 to prevent bots from abusing our file upload system. figure 1 shows the common layout for all components except for dialect id. for dialect id, we use a map to visualize results. to this end, we provide a heatmap showing the distribution of probabilities for different dialects. this allows users to easily determine which part of the world the input text is likely to come from. figure 2 illustrates layout for dialect id. we also allow users to send feedback to us. this will help us improve asad in the future. figure 2: asad interface for dialect id module implementation we use flask foot_7 , a lightweight web application framework for backend development. input from the user is first transformed into n-gram vectors using tf-idf vectorizer and then are passed to the classifiers (described in section 4). the classifiers return predicted labels alongside probabilities of different classes. the class probabilities were calculated using platt calibration @xcite . we use scikit-learn foot_8 to train all the