Views
No views yet
(Neutral-Hate)
on a sampled version of a custom Egyptian-Arabic hate speech dataset.1import torch
2from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
3
4device = "cuda:0" if torch.cuda.is_available() else "cpu"
5
6model = AutoModelForSequenceClassification.from_pretrained("IbrahimAmin/marbertv2-finetuned-egyptian-hate-speech-detection")
7tokenizer = AutoTokenizer.from_pretrained("IbrahimAmin/marbertv2-finetuned-egyptian-hate-speech-detection")
8
9classifier = pipeline("text-classification", model=model, tokenizer=tokenizer, device=device)
10result = classifier("مبحبش الخلايجه")
11print(result)@INPROCEEDINGS{10009167,
author={Ahmed, Ibrahim and Abbas, Mostafa and Hatem, Rany and Ihab, Andrew and Fahkr, Mohamed Waleed},
booktitle={2022 20th International Conference on Language Engineering (ESOLEC)},
title={Fine-tuning Arabic Pre-Trained Transformer Models for Egyptian-Arabic Dialect Offensive Language and Hate Speech Detection and Classification},
year={2022},
volume={20},
number={},
pages={170-174},
keywords={Social networking (online);Text categorization;Hate speech;Blogs;Transformers;Natural language processing;Task analysis;Arabic Hate Speech;Natural Language Processing;Transformers;Text Classification},
doi={10.1109/ESOLEC54569.2022.10009167}}