File size: 1,332 Bytes
cd12c0f
68e2945
 
 
30b1804
 
 
68e2945
 
 
 
 
 
30b1804
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
language:
- ar
- fr
- en
license: mit
base_model: xlm-roberta-base
tags:
- text-classification
- comment-moderation
- darija
- code-switching
- nlp
metrics:
- accuracy
---

# Relevant / Irrelevant Comment Classifier

A fine-tuned `xlm-roberta-base` model that classifies social media comments as **relevant** or **irrelevant** to the topic they were posted under.

Trained on real-world telecom customer comments (French, Darija, and Arabic), where "irrelevant" covers off-topic chatter, spam, or unrelated remarks mixed in with genuine customer feedback.

## Usage

```python
from transformers import pipeline

classifier = pipeline("text-classification", model="Chaima-KHENAFIF/relevant-comment-detector")
classifier("la connexion est très lente")
```

## Training

Fine-tuned on ~2,000 labeled comments scraped from telecom operator social media pages, covering French, Darija (Latin and Arabic script), and Arabic.

## Training results

| Epoch | Train Loss | Val Loss | Val Accuracy |
|---|---|---|---|
| 1 | 0.5005 | 0.2117 | 93.56% |
| 2 | 0.2171 | 0.1577 | **95.05%** |
| 3 | 0.1743 | 0.1530 | 94.06% |
| 4 | 0.1322 | 0.1546 | 93.56% |

Best validation accuracy of **95.05%** reached at epoch 2.

## Links

- Full code and training pipeline: [GitHub repo](https://github.com/chaima-Khenafif03/relevant-comment-detector)