{"id":31649275,"url":"https://github.com/christabelsakyi/sentiment_analysis","last_synced_at":"2026-05-07T15:39:55.894Z","repository":{"id":318186035,"uuid":"1069367438","full_name":"christabelsakyi/Sentiment_Analysis","owner":"christabelsakyi","description":"This project involves analyzing customer reviews to classify them as positive or negative using Logistic Regression. The workflow includes text preprocessing, feature extraction, training a model, making predictions, and evaluating its performance. Dataset","archived":false,"fork":false,"pushed_at":"2025-10-05T17:02:21.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T18:26:00.002Z","etag":null,"topics":["imblearn","machine-learning","nltk","numpy","python","sklearn"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christabelsakyi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T20:23:45.000Z","updated_at":"2025-10-05T17:03:51.000Z","dependencies_parsed_at":"2025-10-05T18:26:02.082Z","dependency_job_id":"53a9646b-407e-4cec-8b08-8eaa39ab0417","html_url":"https://github.com/christabelsakyi/Sentiment_Analysis","commit_stats":null,"previous_names":["christabelsakyi/sentiment_analysis"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/christabelsakyi/Sentiment_Analysis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christabelsakyi%2FSentiment_Analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christabelsakyi%2FSentiment_Analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christabelsakyi%2FSentiment_Analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christabelsakyi%2FSentiment_Analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christabelsakyi","download_url":"https://codeload.github.com/christabelsakyi/Sentiment_Analysis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christabelsakyi%2FSentiment_Analysis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278740831,"owners_count":26037480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["imblearn","machine-learning","nltk","numpy","python","sklearn"],"created_at":"2025-10-07T07:41:54.244Z","updated_at":"2025-10-07T07:41:57.463Z","avatar_url":"https://github.com/christabelsakyi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Text Classification with Logistic Regression for Sentiment Analysis\n\n## Project Overview\nThis project involves analyzing customer reviews to classify them as **positive** or **negative** using **Logistic Regression**. The workflow includes text preprocessing, feature extraction, training a model, making predictions, and evaluating its performance.\n\n## Dataset  \nThe dataset consists of customer reviews labeled with sentiment scores:  \n- **Review**: The text of the customer’s review  \n- **Sentiment**: The target variable (1 = Positive, 0 = Negative)  \n\n**Dataset file**: `customer_reviews_sentiment.csv`\n\n## Requirements  \nInstall the necessary dependencies before running the code:  \n```bash\npip install pandas numpy scikit-learn nltk\n```\n\n## Workflow  \n\n### 1. Data Preprocessing  \n- Load the dataset  \n- Handle missing values  \n- Convert text to lowercase  \n- Remove special characters and punctuation  \n- Remove stop words (using NLTK or SpaCy)  \n- Tokenize the text  \n\n### 2. Feature Extraction  \n- Convert text into numerical features using:  \n  - **Bag of Words (BoW)** or  \n  - **TF-IDF (Term Frequency-Inverse Document Frequency)**  \n- Split the dataset into training (80%) and testing (20%) sets  \n\n### 3. Train a Logistic Regression Model  \n- Train a **Logistic Regression classifier** on extracted features  \n- Tune hyperparameters (experiment with regularization parameter **C**)  \n\n### 4. Make Predictions  \n- Predict the sentiment for the following reviews:  \n  - `\"This product is amazing! I love it.\"`  \n  - `\"It broke after one use, completely disappointed.\"`  \n\n### 5. Model Evaluation  \n- Compute **accuracy** on the test dataset  \n- Generate **confusion matrix** and **classification report** (precision, recall, F1-score)  \n\n### 6. Model Improvements  \n- Experiment with other classifiers (e.g., **Naive Bayes, SVM**)  \n- Compare their performance with Logistic Regression  \n\n## Deliverables  \n1. **Preprocessed Dataset**: Cleaned text data  \n2. **Feature-Engineered Dataset**: Extracted numerical features  \n3. **Trained Model**: Logistic Regression with optimized hyperparameters  \n4. **Model Evaluation**: Accuracy, confusion matrix, classification report  \n5. **Sample Predictions**: Results for provided test cases  \n6. **Model Comparison**: Performance of alternative classifiers  \n\n## How to Run the Code  \n1. Ensure the dataset is available as `customer_reviews_sentiment.csv`  \n2. Run the preprocessing and feature extraction scripts  \n3. Train the Logistic Regression model  \n4. Evaluate performance and compare models  \n\n## Author  \n**Pedahel Emmanuel Kojo**  \nSenior Software Engineer, Machine Learning Engineer at CSP\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristabelsakyi%2Fsentiment_analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristabelsakyi%2Fsentiment_analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristabelsakyi%2Fsentiment_analysis/lists"}