CoolFace
Modelpublic

imaether/roberta-offensive-junior

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes13downloads
README.md54 linesDownload Raw Back to root
1---2license: mit3language:4- en5---6# RoBERTa | Hate detection7 8![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/636ece7267692798149ece54/YEWRDsqwGdf--wiSiCLUa.jpeg)9 10#### Overview11 12This is a finetuned version of [RoBERTa base](https://huggingface.co/FacebookAI/roberta-base), finetuned for detecting extreme hate (i.e extreme racism, homophobia, and suicide incitement)13 14This model is actively being improved and used in the AetherJr Discord bot.15 16#### Training Info17This model was trained on 121753 messages for 3 epochs using an NVIDIA RTX 3080 (10gb).18 19- learning_rate: 3e-520- train_batch_size: 821- F1: 0.942366022- Recall: 0.952169423 24- Total Offensive/Bad: 145625- Total Normal: 12029926 27#### Dataset used28This model was trained on a collection of Discord messages obtained from various public chats across multiple servers, with the explicit permission of the server owners.29The dataset was chosen for its relevance to the model's objective of detecting extreme racism, homophobia, and suicide incitement in online communications. To ensure privacy, all data has been anonymized, with personal identifiers and links removed.30 31The dataset used for this model will not be publicly released.32 33#### Limitations and Bias34The dataset, primarily from English-speaking servers with intense hate content, may limit the model's ability to effectively recognize and understand non-English hate expressions. 35 36Also, the hate data consists of mostly slurs, short 2-3 sentence hate and is highly directed at black/gay people, as such, it may not recognize more generic/subtle forms of hate.37### Inference38The simplest way to use this model is using [pipelines](https://huggingface.co/docs/transformers/main_classes/pipelines)\39⚠️ Make sure to pre-process your input text, removing links and ids as the model has a maximum input length of 512, you could also split the input into 512 long segments and do some math to calculate the score. It's up to you.  40```python41import torch42from transformers import pipeline43 44device = 'cuda:0' if torch.cuda.is_available() else 'cpu'45classifier = pipeline(task="text-classification", model="imaether/roberta-offensive-junior", device=device) # add `top_k=None` if you want all scores to be returned46 47in_text = "this is a very cool and real example!"48 49model_output = classifier(in_text)50print(model_outputs)51# Output: [{'label': 'normal', 'score': 0.9999141693115234}]52```53 54