File size: 2,721 Bytes
9337f8c
d8219a1
 
 
 
 
 
 
 
 
 
 
 
 
 
9337f8c
d8219a1
 
 
be5ca6c
 
 
 
 
 
 
 
d8219a1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
be5ca6c
d8219a1
 
be5ca6c
d8219a1
 
 
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
language:
- ar
- fr
- en
tags:
- tunisian-arabic
- arabic-dialect
- tech-qa
- alpaca
- instruction-tuning
- nlp
license: cc-by-4.0
size_categories:
- 1K<n<10K
---

# Reddit Tunisia Tech QA Dataset

The pipeline employs a multi-layer scraping strategy to collect Tunisian Arabic tech QA pairs from Reddit.
It combines three data sources: the Reddit JSON API for real-time posts and comment threads, RSS feeds for post discovery with JSON
comment fetching, and Arctic Shift for historical data. 
The system builds both direct QA pairs (post → top comment) and conversation chains (comment → reply) to capture nuanced technical discussions.
Each pair is scored using a quality function that considers length, tech relevance, and upvotes, then filtered and ranked 
to produce the top 5,000 high-quality instruction pairs. The final dataset is formatted in Alpaca standard and uploaded 
to Hugging Face with automatic train/test splitting.
**results**:
**5,500 instruction-following QA pairs** scraped from Reddit communities with
strong Tunisian presence, filtered and ranked for technical relevance.

Built as part of the **TunisIA-Co-Lab** initiative to create Tunisian Arabic NLP
resources.

## Quality summary

| Metric | Value |
|--------|-------|
| Total pairs | 5,500 |
| Avg quality score | 0.634 |
| Avg tech confidence | 0.0275 |

## Dialect distribution

| Dialect | Count |
|---------|-------|
| mixed | 5104 |
| tunisian_arabizi | 165 |
| french | 117 |
| arabic | 110 |
| tunisian_arabic | 4 |

## Dataset structure (Alpaca format)

| Column | Description |
|--------|-------------|
| `instruction` | Reddit post title (+ body when present) |
| `input` | Always `""` (Alpaca standard) |
| `output` | Top/best Reddit comment as the answer |
| `source` | Subreddit origin |
| `dialect` | `tunisian_arabic`, `tunisian_arabizi`, `french`, `arabic`, `mixed` |
| `quality_score` | Holistic quality 0–1 (length × tech density × upvotes) |
| `comment_score` | Reddit upvotes on the answer comment |
| `chain_depth` | 0 = direct reply to post; >0 = reply-to-reply conversation chain |
| `tech_confidence` | Tech-density confidence 0–1 |
| `layer` | Data source layer: `json_api`, `json_api_chain`, `rss`, `arctic_shift` |

## Sources

Scraped from: r/Tunisia, r/learnprogramming, r/cscareerquestions,
r/datascience, r/MachineLearning, r/Python, r/webdev, r/freelance,
r/digitalnomad.

## Usage

```python
from datasets import load_dataset
ds = load_dataset("Farah21/Tunisia_Tech")
print(ds["train"][0])
```

## Citation

```bibtex
@dataset{tunisian_tech_qa_2026,
  title={Reddit Tunisia Tech QA},
  author={TunisIA-Co-Lab},
  year={2026},
  url={https://huggingface.co/datasets/Farah21/Tunisia_Tech}
}
```