Topic modeling approach for tunisian social media posts
# TunVeCTM β Topic Modeling of Tunisian Dialect on Social Media
Topic modeling pipeline for user-generated **Tunisian dialect** text (Arabizi and Arabic script) from social media, using **Contextualized Topic Models (CTM)** built on several combined embedding strategies.
This repo accompanies:
- π *TunVeCTM: A Topic Modeling Approach of Tunisian Dialect on Social Media*
- π *Topic Modeling of User-Generated Arabic on Social Media: A Systematic Literature Review*
- π Master's Thesis: *Topic Modeling of Tunisian Dialect on Social Media: A Contextual Approach using Combined Embeddings* β ISG Tunis, 2025
## π§ Overview
Tunisian dialect on social media is highly informal and code-switched (Arabic script, Latin script/Arabizi, French loanwords), which makes standard topic modeling tools a poor fit. This project addresses that by:
1. Applying dialect-specific preprocessing (custom stopword removal, character elongation normalization, Arabizi digit-to-letter conversion)
2. Generating and comparing **7 embedding strategies**, each feeding a Combined Topic Model (CombinedTM)
3. Evaluating each configuration with topic coherence metrics (**C_V**, **NPMI**) across a grid of topic counts
## π Repository Structure
Each embedding combination has its **own self-contained notebook** β every notebook repeats the shared preprocessing steps so it can be run independently, without needing to run the others first.
```
tunvectm/
βββ notebooks/
β βββ 01_tunbert_baseline.ipynb # TunBERT contextual embeddings (baseline)
β βββ 02_tunbert_fasttext.ipynb # TunBERT + FastText (subword robustness)
β βββ 03_e5_tunbert.ipynb # E5 (multilingual) + TunBERT
β βββ 04_sbert_tunbert.ipynb # SBERT (multilingual) + TunBERT
β βββ 05_tunbert_doc2vec.ipynb # TunBERT + Doc2Vec (corpus-trained)
β βββ 06_arabertopic.ipynb # AraBERT only β MSA baseline (no TunBERT)
β βββ 07_rober2vectm.ipynb # XLM-RoBERTa (Arabic) + Doc2Vec
βββ data/
β βββ README.md β¦