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.
Normalize the text before classifying as the model uses normalized text. Here's how to use the model:
1pip install setfit
2from setfit import SetFitModel
3from unicodedata import normalize
4
5# Download model from Hub
6model = SetFitModel.from_pretrained("akhooli/setfit_ar_sst2")
7# Run inference
8queries = [
9 "يغلي الماء عند 100 درجة مئوية",
10 "فعلا لقد أحببت ذلك الفيلم",
11 "🤮 اﻷناناس مع البيتزا؟ إنه غير محبذ",
12 "رأيت أناسا بائسين في الطريق",
13 "لم يعجبني المطعم رغم أن السعر مقبول",
14 "من باب جبر الخاطر هذه 3 نجوم لتقييم الخدمة",
15 "من باب جبر الخواطر، هذه نجمة واحدة لخدمة ﻻ تستحق"
16 ]
17queries_n = [normalize('NFKC', query) for query in queries]
18preds = model.predict(queries_n)
19print(preds)
20# if you want to see the probabilities for each label
21probas = model.predict_proba(queries_n)
22print(probas)
The rest of this card is auto-generated.
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")
5# Run inference
6preds = model("لقد تم إنجازه من قبل ولكن لم يكن بهذه الوضوح أو بهذا القدر من الشغف. ")
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}