This is a setfit hate speech detection model (86 % accuracy/f1) based on the
Ar Hate Speech dataset.
1pip install setfit
2from setfit import SetFitModel
3from unicodedata import normalize
4
5# Download model from Hub
6model = SetFitModel.from_pretrained("akhooli/setfit_ar_hs")
7# Run inference
8queries = [
9 "سكت دهراً و نطق كفراً",
10 "الخلاف ﻻ يفسد للود قضية.",
11 "أنت شخص منبوذ. احترم أسيادك.",
12 "دع المكارم ﻻ ترحل لبغيتها واقعد فإنك أنت الطاعم الكاسي",
13 ]
14queries_n = [normalize('NFKC', query) for query in queries]
15preds = model.predict(queries_n)
16print(preds)
17# if you want to see the probabilities for each label
18probas = model.predict_proba(queries_n)
19print(probas)
The rest of this content is auto-generated.
This is a
SetFit model that can be used for Text Classification. This SetFit model uses
akhooli/sbert_ar_nli_500k_norm as the Sentence Transformer embedding model. A
LogisticRegression instance is used for classification.
The model has been trained using an efficient few-shot learning technique that involves:
Then you can load this model and run inference.
1from setfit import SetFitModel
2
3# Download from the 🤗 Hub
4model = SetFitModel.from_pretrained("akhooli/setfit_ar_hs")
5# Run inference
6preds = model("شيوعي
7علماني
8مسيحي
9انصار سنه
10صوفي
11يمثلك التجمع
12لا يمثلك التجمع
13اهلا بكم جميعا فنحن نريد بناء وطن ❤")
1@article{https://doi.org/10.48550/arxiv.2209.11055,
2 doi = {10.48550/ARXIV.2209.11055},
3 url = {https://arxiv.org/abs/2209.11055},
4 author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
5 keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
6 title = {Efficient Few-Shot Learning Without Prompts},
7 publisher = {arXiv},
8 year = {2022},
9 copyright = {Creative Commons Attribution 4.0 International}
10}