Logo Lanfrica

ZedoMak/amharic-nlp

Domain:

natural language processing

Record type:

software
Creator:
Zed
Host:
# Amharic NLP Sentiment Classifier This project builds a simple sentiment classifier for Amharic tweets. It downloads a labeled dataset, cleans the text, trains TF-IDF based machine learning models, compares baseline classifiers, and provides an interactive prediction script. The current baseline is a Logistic Regression classifier trained on word-level unigram and bigram TF-IDF features. ## Project Structure ```text . |-- download_data.py # Download train/test CSV files |-- explore.py # Inspect dataset shape, labels, and missing values |-- data/ # Local data files, ignored by git |-- models/ # Saved model artifacts | |-- logistic_model.pkl | `-- tfidf.pkl |-- reports/ | `-- model_comparison.md # Evaluation results and model decision `-- src/ |-- compare_models.py # Compare baseline classifiers |-- predict.py # Interactive sentiment prediction |-- prepare_data.py # Clean and save preprocessed training data |-- preprocess.py # Text cleaning helper `-- train.py # Train and save the Logistic Regression model ``` ## Labels The classifier predicts one of four sentiment labels: - `mixed` - `negative` - `neutral` - `positive` ## Setup Create and activate a virtual environment: ```bash python -m venv venv source venv/bin/activate ``` Install the required Python packages: ```bash pip install pandas scikit-learn joblib ``` ## Data Preparation Download the raw dataset: ```bash python download_data.py ``` Inspect the raw data: ```bash python explore.py ``` Create the preprocessed training file: ```bash python src/prepare_data.py ``` This writes: ```text data/preprocessed_train.csv ``` The `data/` directory is ignored by git, so run the download and preprocessing steps again when setting up the project on a new machine. ## Training Train the current baseline model: ```bash python src/train.py ``` This sa …

Languages