Deploying Unified BERT Moderation Model for E -Commerce Reviews (2022)

Abstract: Moderation of user-generated e-commerce content has become crucial due to the large and diverse user base on the platforms. Product reviews and ratings have become an integral part of the shopping experience to build trust among users. Due to the high volume of reviews generated on a vast catalog of products, manual moderation is infeasible, making machine moderation a necessity. In this work, we described our deployed system and models for automated moderation of user-generated content. At the heart of our approach, we outline several rejection reasons for review & rating moderation and explore a unified BERT model to moderate them. We convey the importance of product vertical embeddings for the relevancy of the review for a given product and highlight the advantages of pre-training the BERT models with monolingual data to cope with the domain gap in the absence of huge labelled datasets. We observe a 4.78% F1 increase with less labelled data and a 2.57% increase in F1 score on the review data compared to the publicly available BERT-based models. Our best model In-House-BERT-vertical sends only 5.89% of total reviews to manual moderation and has been deployed in production serving live traffic for millions of users.

## introduction the internet has enabled the easy flow of information across the globe, but it has its downside too. it has led to increased hate speech and abusive communication @xcite . it is necessary to prevent people from accessing our personal information, as it can be used for malicious purposes. the platforms that enable people to communicate and convey their opinions are also responsible for preventing profane content from affecting their users. so such platforms must have strict guidelines and strong moderation of user-generated content. the downside of manual moderation involves inconsistency in labelling, the inability to real-time moderation, lack of domain knowledge, and multilingual vocabulary. due to the immense scale of the data that has been ingested on such platforms, auto-moderation becomes vital as manual moderation is not economical. the e-commerce domain accepts multi-modal data such as text, images, and videos @xcite . it is crucial to moderate them before the platform users consume the data. this paper mainly concentrates on the moderation of textual review data. reviews and ratings build trust in the product and help platforms promote good products @xcite . thus eliminating reviews that do not talk about the product becomes necessary. the aim of moderating reviews is not only to detect abusive or hate speech content but also to check whether a review follows other guidelines before posting it. before rejecting a review, it is necessary to predict the reason for rejection as feedback to the users. we have multiple reasons for rejecting a review. these are mentioned in publicly available base bert @xcite is considered the baseline, and we try different architectures and configurations that help in better moderation. we use a pre-trained in-house-bert model, which has been trained on monolingual review text and product descriptions. pre-training helps create generic representations and adds robustness to the model @xcite . we freeze embedding and initial 8 layers @xcite as it helps in faster training time without degrading the model's performance. we use product vertical / category names as an embedding to help understand the relevance of the review for that given product. we augment data with var-ious obfuscations and noise to make the model robust to hard rejection reasons such as detecting profane/abusive content. finally, we incorporate all these techniques to fine-tune a unified in-house-bert moderation model to obtain an f1 score of, which is 2.57% improvement on the publicly available baseline models. there are multiple scenarios where an automoderation model may fail, such as significantly morphed text, sarcastic content, or unseen data. in such a scenario, we fall back to manual moderation @xcite . our aim is not to fully eliminate manual moderation but instead to decrease the volume of data that goes to the moderators. when the model is not confident of its predictions, we send it for manual checks before approving it, considering it as the last line of defence. our major contributions from the work include: ## related work moderation use cases started as early as the email era and the need increased with the rise of socialmedia @xcite . traditionally hand-crafted rules were used along with basic profane word list matching. people started finding different ways to format and morph the text to bypass these systems. this paved the way sophisticated approaches with machine learning algorithms like tf-idf (gaydhani et al., 2018), svm @xcite and deep learning algorithms @xcite @xcite . most of the research has been around detection of profane, hate-speech and abuse detection in the user-generated content @xcite @xcite . to the best of our knowledge, we haven't found any guidelines for review moderation other than detecting profane content and fake reviews @xcite @xcite . we introduce sophisticated moderation guidelines for reviews and ratings in the e-commerce domain. dataset creation is a huge challenge as there will be imbalanced classes across various rejection reasons. huge datasets are available for profane and hate speech content which can be curated from twitter, reddit, and other social media texts @xcite . these include monolingual, multilingual (i orts, 2019; @xcite and code-mixed data @xcite . emojis are an important part of expressing emotions and are used to spread hate. hatemoji @xcite , is an abusive emoji dataset that has been created adversarially. various bert @xcite based approaches have been taken to detect profane and hate speech content. hate-bert @xcite , is a fine-tuned bert model on abusive content from reddit comments. deep-bert @xcite , is a multilingual hate detection approach using transfer learning methods. google has come up with their perspective 3 api @xcite which uses a multilingual charformer model @xcite to detect hateful content in a range of languages, domains and tasks. these models are generally prone to various noise attacks like adding small obfuscations or randomly changing a few characters, and its case @xcite . significant research has been done to prevent adversarial attacks @xcite on these models, and approaches like adding obfuscations and transformations to the text have shown improvements @xcite . hybrid approaches of keeping humans in the loop along with the auto-moderation are also explored, which we too make use of @xcite . ## proposed approach we propose an end-to-end approach that uses a hybrid of deterministic and model-based approaches, and the data flow is shown in figure 2 . ## conclusion pre-training bert on large monolingual data from a similar distribution as fine-tuning gives similar results if we have large enough training data. when labelled data is scarce, we observe the advantages of pre-training the bert models with the monolingual corpora giving a 4.78% increase in f1. freezing the embedding layer and a few of the initial layers of the in-house-bert model helps reduce the training time while not compromising the model's performance. decoupling some of the rejection reasons by adding extra embeddings boosts the f1 scores. our hybrid approach achieves an f1 score of 88.45 and sends 5.89% for manual moderation.