{"id":27123990,"url":"https://github.com/markkreel/sentiment-analysis-api","last_synced_at":"2026-04-29T01:34:03.110Z","repository":{"id":160152460,"uuid":"462313028","full_name":"Markkreel/Sentiment-Analysis-API","owner":"Markkreel","description":"A machine learning API for analyzing sentiment in text phrases using Natural Language Processing (NLP) techniques.","archived":false,"fork":false,"pushed_at":"2025-03-24T19:07:12.000Z","size":2379,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T13:20:05.190Z","etag":null,"topics":["api","flask","machine-learning","python","sentiment-analysis"],"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/Markkreel.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}},"created_at":"2022-02-22T13:36:40.000Z","updated_at":"2025-03-24T19:07:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a4497baa-eb55-497c-99f8-1b0203d5ac23","html_url":"https://github.com/Markkreel/Sentiment-Analysis-API","commit_stats":null,"previous_names":["markkreel/sentiment-analysis-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Markkreel/Sentiment-Analysis-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Markkreel%2FSentiment-Analysis-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Markkreel%2FSentiment-Analysis-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Markkreel%2FSentiment-Analysis-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Markkreel%2FSentiment-Analysis-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Markkreel","download_url":"https://codeload.github.com/Markkreel/Sentiment-Analysis-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Markkreel%2FSentiment-Analysis-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32407164,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","flask","machine-learning","python","sentiment-analysis"],"created_at":"2025-04-07T13:20:09.380Z","updated_at":"2026-04-29T01:34:03.093Z","avatar_url":"https://github.com/Markkreel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentiment Analysis API\n\nA machine learning API for analyzing sentiment in text phrases using Natural Language Processing (NLP) techniques.\n\n## Features\n\n- Binary sentiment classification (positive/negative)\n- REST API endpoint for predictions\n- Model training pipeline with TF-IDF vectorization\n- Multinomial Naive Bayes classifier\n- ROC curve evaluation metrics\n\n## Installation\n\n1. Clone repository\n2. Create virtual environment:\n\n   ```bash\n   python -m venv venv\n   venv\\Scripts\\activate\n   ```\n\n3. Install dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n## Dependencies\n\n- Flask\n- scikit-learn\n- pandas\n- matplotlib\n\n## Project Structure\n\n```json\n├── app.py              # Flask API endpoints\n├── build_model.py      # Model training script\n├── model.py            # NLP model class definition\n├── requirements.txt    # Dependency list\n├── sentiment_data/     # Training data (TSV files)\n└── chalicelib/models/  # Saved model artifacts\n```\n\n## Usage\n\n1. Train the model:\n\n   ```bash\n   python build_model.py\n   ```\n\n2. Start the API:\n\n   ```bash\n   flask run\n   ```\n\n## API Endpoints\n\nGET `/sentiment`\n\n- Parameters:\n  - `sentence`: Text phrase to analyze\n- Example:\n\n  ```bash\n  http://localhost:5000/sentiment?sentence=\"I really enjoy this product\"\n  ```\n\n- Response:\n\n  ```json\n  {\n    \"sentence\": \"I really enjoy this product\",\n    \"sentiment\": \"positive\",\n    \"probability\": 0.92\n  }\n  ```\n\n## Implementation Details\n\nThe system uses:\n\n- TF-IDF vectorization for text feature extraction\n- Multinomial Naive Bayes classifier (scikit-learn)\n- ROC AUC score of 0.93 on test data\n- Model artifacts persisted as pickle files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkkreel%2Fsentiment-analysis-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkkreel%2Fsentiment-analysis-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkkreel%2Fsentiment-analysis-api/lists"}