Logo Lanfrica

hamzaaboutaleb/NLP-darija_summarization

Domain:

natural language processing

Record type:

software
Creator:
ham
Host:
# πŸ‡²πŸ‡¦ 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 # …