Logo Lanfrica

meyladj/algerian-multilingual-nlp-sentiment

Domain:

natural language processing

Record type:

softwareproject
Creator:
mey
Host:
# πŸ‡©πŸ‡Ώ Algerian Multilingual NLP Sentiment Analyzer A specialized Machine Learning Natural Language Processing pipeline designed to classify sentiments in complex multilingual contexts prevalent in Algeria and North Africa. --- ## πŸ’‘ Overview In Algeria, social conversations and community feedback naturally fluidly combine **Standard Arabic**, **Algerian Darija (both Arabic script and Latin Arabizi with digits 3, 7, 9, 5)**, **French**, and **English**. Standard off-the-shelf sentiment models struggle heavily with this code-switching reality. This project implements: 1. **Multilingual Code-Switching Normalizer**: Removes diacritics, normalizes Arabic variants, handles Arabizi phonetics and character repetitions. 2. **Subword & N-Gram TF-IDF Vectorization**: Preserves character-level dialect markers and morphological roots. 3. **Calibrated Logistic / Softmax Classification**: Produces probability distributions across Positive, Neutral, and Negative classes. --- ## ⚑ Quick Start ### 1. Installation ```bash git clone github.com /algerian-multilingual-nlp-sentiment.git cd algerian-multilingual-nlp-sentiment pip install -r requirements.txt ``` ### 2. Interactive CLI Mode ```bash python app.py ``` ### 3. Example Code Usage ```python from sentiment_classifier import AlgerianSentimentAnalyzer analyzer = AlgerianSentimentAnalyzer() analyzer.train() result = analyzer.predict("raw3a had l'projet, foooort bzaf!") print(result['predicted_sentiment']) # Output: positive print(result['confidence']) # Output: 0.94 ``` ### 4. Batch Prediction ```bash python app.py --batch sample_inputs.txt --out predictions.json ``` --- ## πŸ“Š Pipeline Architecture ``` [Raw User Text (Arabic / Darija / Arabizi / FR / EN)] ↓ [Multilingual Normalization & Arabizi Handler] ↓ [Character & Word N-Gram TF-IDF] ↓ [Calibrated Multiclass Logistic Classifier] ↓ { Sentiment: "Positive", Confidence: 0.94 } ``` --- ## πŸ“„ License MIT License - Developed with pride by an Algeria …