AMR-KELEG commited on
Commit
2eb17ac
·
verified ·
1 Parent(s): abfae82

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +58 -4
README.md CHANGED
@@ -1,13 +1,45 @@
1
  ---
2
  inference: false
3
  ---
4
- # Model Card for Sentence-ALDi
5
 
6
- [![GitHub](https://img.shields.io/badge/💻-GitHub%20-black.svg)](https://github.com/AMR-KELEG/ALDi)
7
 
8
  <!-- Provide a quick summary of what the model is/does. -->
9
 
10
- A BERT-based model fine-tuned to estimate the Arabic Level od Dialectness of text.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
  ### Model Description
13
 
@@ -19,4 +51,26 @@ A BERT-based model fine-tuned to estimate the Arabic Level od Dialectness of tex
19
  <!--- **License:** [More Information Needed] -->
20
  - **Finetuned from model :** [MarBERT](https://huggingface.co/UBC-NLP/MARBERT)
21
 
22
- More information coming soon!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  inference: false
3
  ---
4
+ # Model Card for Sentence-ALDi-50
5
 
6
+ [![GitHub](https://img.shields.io/badge/💻-GitHub%20-black.svg)](https://github.com/AMR-KELEG/ALDi) [![Huggingface Space](https://img.shields.io/badge/🤗-Demo%20-yellow.svg)](https://huggingface.co/spaces/AMR-KELEG/ALDi)
7
 
8
  <!-- Provide a quick summary of what the model is/does. -->
9
 
10
+ A BERT-based model fine-tuned to estimate the Arabic Level of Dialectness of text.
11
+
12
+ Model | Link on 🤗
13
+ ---|---
14
+ **Sentence-ALDi** (random seed: 42) | https://huggingface.co/AMR-KELEG/Sentence-ALDi
15
+ Sentence-ALDi (random seed: 30) | https://huggingface.co/AMR-KELEG/Sentence-ALDi-30
16
+ Sentence-ALDi (random seed: 50) | https://huggingface.co/AMR-KELEG/Sentence-ALDi-50
17
+ **Token-DI** (random seed: 42) | https://huggingface.co/AMR-KELEG/ALDi-Token-DI
18
+ Token-DI (random seed: 30) | https://huggingface.co/AMR-KELEG/ALDi-Token-DI-30
19
+ Token-DI (random seed: 50) | https://huggingface.co/AMR-KELEG/ALDi-Token-DI-50
20
+
21
+ ### Usage
22
+
23
+ ```
24
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
25
+ model_name = "AMR-KELEG/Sentence-ALDi-50"
26
+
27
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
28
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
29
+
30
+ def compute_score(sentence):
31
+ inputs = tokenizer(sentence, return_tensors="pt")
32
+ outputs = model(**inputs)
33
+ logits = outputs.logits
34
+ return min(max(0, logits[0][0].item()), 1)
35
+
36
+ if __name__ == "__main__":
37
+ s1 = "الطقس جيد اليوم"
38
+ s2 = "الجو حلو النهاردة"
39
+
40
+ print(s1, round(compute_score(s1), 3)) # 0
41
+ print(s2, round(compute_score(s2), 3)) # 0.951
42
+ ```
43
 
44
  ### Model Description
45
 
 
51
  <!--- **License:** [More Information Needed] -->
52
  - **Finetuned from model :** [MarBERT](https://huggingface.co/UBC-NLP/MARBERT)
53
 
54
+ ### Citation
55
+
56
+ If you find the model useful, please cite the following respective paper:
57
+ ```
58
+ @inproceedings{keleg-etal-2023-aldi,
59
+ title = "{ALD}i: Quantifying the {A}rabic Level of Dialectness of Text",
60
+ author = "Keleg, Amr and
61
+ Goldwater, Sharon and
62
+ Magdy, Walid",
63
+ editor = "Bouamor, Houda and
64
+ Pino, Juan and
65
+ Bali, Kalika",
66
+ booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
67
+ month = dec,
68
+ year = "2023",
69
+ address = "Singapore",
70
+ publisher = "Association for Computational Linguistics",
71
+ url = "https://aclanthology.org/2023.emnlp-main.655",
72
+ doi = "10.18653/v1/2023.emnlp-main.655",
73
+ pages = "10597--10611",
74
+ abstract = "Transcribed speech and user-generated text in Arabic typically contain a mixture of Modern Standard Arabic (MSA), the standardized language taught in schools, and Dialectal Arabic (DA), used in daily communications. To handle this variation, previous work in Arabic NLP has focused on Dialect Identification (DI) on the sentence or the token level. However, DI treats the task as binary, whereas we argue that Arabic speakers perceive a spectrum of dialectness, which we operationalize at the sentence level as the Arabic Level of Dialectness (ALDi), a continuous linguistic variable. We introduce the AOC-ALDi dataset (derived from the AOC dataset), containing 127,835 sentences (17{\%} from news articles and 83{\%} from user comments on those articles) which are manually labeled with their level of dialectness. We provide a detailed analysis of AOC-ALDi and show that a model trained on it can effectively identify levels of dialectness on a range of other corpora (including dialects and genres not included in AOC-ALDi), providing a more nuanced picture than traditional DI systems. Through case studies, we illustrate how ALDi can reveal Arabic speakers{'} stylistic choices in different situations, a useful property for sociolinguistic analyses.",
75
+ }
76
+ ```