Logo Lanfrica

hamzaaboutaleb/NLP-darija_summarization

Domaine:

natural language processing

Type de record:

software
Créateur:
ham
HĂ´te:
# 🇲🇦 Darija Text Summarization Automatic text summarization for **Moroccan Darija** — three independent approaches ranging from classical NLP to deep learning, all trained/evaluated on the same CSV dataset. --- ## Repository Structure ``` darija-summarization/ │ ├── approach_1_nlp_extractive.py # TF-IDF sentence scoring (NLP) ├── approach_2_ml_transformers.py # HuggingFace seq2seq fine-tuning (Deep ML) ├── approach_3_ml_textrank.py # TextRank graph algorithm (Classical ML) │ ├── dataset.csv # Your Darija dataset (add this) ├── requirements.txt # All dependencies └── README.md ``` --- ## Dataset Format Place your dataset at the root as `dataset.csv` with at least these two columns: | Column | Description | |-----------|----------------------------------------------| | `text` | Full Darija text to summarize | | `summary` | Reference summary *(optional, for eval only)*| > The scripts default to `text` and `summary` column names. You can change these via the `TEXT_COL` / `SUMMARY_COL` constants at the top of each file. --- ## 🔬 Approach Comparison | | Approach 1 | Approach 2 | Approach 3 | |---|---|---|---| | **File** | `approach_1_nlp_extractive.py` | `approach_2_ml_transformers.py` | `approach_3_ml_textrank.py` | | **Type** | Extractive | **Abstractive** | Extractive | | **Algorithm** | TF-IDF sentence scoring | mT5 / mBART fine-tuning | TextRank (PageRank on sentences) | | **Needs labels?** | No | Yes | No | | **Needs GPU?** | No | Recommended | No | | **Output style** | Picks original sentences | Generates new text | Picks original sentences | | **Speed** | Very fast | Slow (training) | Fast | | **Best for** | Quick baseline | Highest quality | Balanced accuracy/speed | --- ## Quick Start ### 1. Install dependencies ```bash pip install -r requirements.txt ``` Or install per approach: ```bash # Approach 1 pip install nltk scikit-learn pandas # …