File size: 3,945 Bytes
b82c4aa
 
4c9497d
 
 
 
 
 
b82c4aa
4c9497d
 
 
 
 
 
 
 
0fbf41a
4c9497d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40c8068
 
 
4c9497d
 
40c8068
 
 
4c9497d
 
 
40c8068
4c9497d
40c8068
 
 
4c9497d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
license: mit
pipeline_tag: token-classification
language: 
  - ar
widget:
 - text: 'انه يحب اكل الطعام بكثره'

---


# CAMeLBERT-MSA ZAEBUC GED-13 Model

## Model description
**CAMeLBERT-MSA ZAEBUC GED-13 Model** is a Modern Standard Arabic (MSA) grammatical error detection (GED) model that was built by fine-tuning the [CAMeLBERT-MSA](https://huggingface.co/CAMeL-Lab/bert-base-arabic-camelbert-msa/) model.
For the fine-tuning, we used a combination of the [QALB-2014](https://aclanthology.org/W14-3605.pdf), [QALB-2015](https://aclanthology.org/W15-3204.pdf), and [ZAEBUC](https://aclanthology.org/2022.lrec-1.9.pdf) datasets. Please note that this model was fine-tuned on morphologically preprocessed text.
Our fine-tuning procedure and the hyperparameters we used can be found in our paper *"[Advancements in Arabic Grammatical Error Detection and Correction:
An Empirical Investigation](https://arxiv.org/abs/2305.14734)."* Our fine-tuning code and data can be found [here](https://github.com/CAMeL-Lab/arabic-gec).

## Intended uses
You can use the CAMeLBERT-MSA GED-13 model model as part of the transformers pipeline.

#### How to use
To use the model with a transformers pipeline:
```python
>>> from transformers import pipeline
>>> ged = pipeline('token-classification', model='CAMeL-Lab/camelbert-msa-zaebuc-ged-13')
>>> text = 'و قال له انه يحب اكل الطعام بكثره'
>>> ged(text)
[{'entity': 'MERGE-B', 'score': 0.99943775, 'index': 1, 'word': 'و', 'start': 0, 'end': 1}, {'entity': 'MERGE-I', 'score': 0.99959165, 'index': 2, 'word': 'قال', 'start': 2, 'end': 5}, {'entity': 'UC', 'score': 0.9985884, 'index': 3, 'word': 'له', 'start': 6, 'end': 8}, {'entity': 'REPLACE_O', 'score': 0.8346316, 'index': 4, 'word': 'انه', 'start': 9, 'end': 12}, {'entity': 'UC', 'score': 0.99985325, 'index': 5, 'word': 'يحب', 'start': 13, 'end': 16}, {'entity': 'REPLACE_O', 'score': 0.6836415, 'index': 6, 'word': 'اكل', 'start': 17, 'end': 20}, {'entity': 'UC', 'score': 0.99763715, 'index': 7, 'word': 'الطعام', 'start': 21, 'end': 27}, {'entity': 'REPLACE_O', 'score': 0.993848, 'index': 8, 'word': 'بكثره', 'start': 28, 'end': 33}]
```



## Citation
```bibtex
@inproceedings{alhafni-etal-2023-advancements,
    title = "Advancements in {A}rabic Grammatical Error Detection and Correction: An Empirical Investigation",
    author = "Alhafni, Bashar  and
      Inoue, Go  and
      Khairallah, Christian  and
      Habash, Nizar",
    editor = "Bouamor, Houda  and
      Pino, Juan  and
      Bali, Kalika",
    booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
    month = dec,
    year = "2023",
    address = "Singapore",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.emnlp-main.396",
    doi = "10.18653/v1/2023.emnlp-main.396",
    pages = "6430--6448",
    abstract = "Grammatical error correction (GEC) is a well-explored problem in English with many existing models and datasets. However, research on GEC in morphologically rich languages has been limited due to challenges such as data scarcity and language complexity. In this paper, we present the first results on Arabic GEC using two newly developed Transformer-based pretrained sequence-to-sequence models. We also define the task of multi-class Arabic grammatical error detection (GED) and present the first results on multi-class Arabic GED. We show that using GED information as auxiliary input in GEC models improves GEC performance across three datasets spanning different genres. Moreover, we also investigate the use of contextual morphological preprocessing in aiding GEC systems. Our models achieve SOTA results on two Arabic GEC shared task datasets and establish a strong benchmark on a recently created dataset. We make our code, data, and pretrained models publicly available.",
}
```