{"id":29902867,"url":"https://github.com/sudo-arash/sentence-classifier","last_synced_at":"2025-08-01T16:15:58.479Z","repository":{"id":306612217,"uuid":"1026754427","full_name":"sudo-arash/sentence-classifier","owner":"sudo-arash","description":"Classifies if a sentence is negative or positive.","archived":false,"fork":false,"pushed_at":"2025-07-26T14:46:47.000Z","size":753,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-26T20:07:58.103Z","etag":null,"topics":[],"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/sudo-arash.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}},"created_at":"2025-07-26T14:44:45.000Z","updated_at":"2025-07-26T16:24:14.000Z","dependencies_parsed_at":"2025-07-26T20:09:21.055Z","dependency_job_id":"a24b0ce5-2a6d-4d2a-bbd8-3e4e09c1d43a","html_url":"https://github.com/sudo-arash/sentence-classifier","commit_stats":null,"previous_names":["sudo-arash/sentence-classifier"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sudo-arash/sentence-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsentence-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsentence-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsentence-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsentence-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudo-arash","download_url":"https://codeload.github.com/sudo-arash/sentence-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudo-arash%2Fsentence-classifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268257478,"owners_count":24221059,"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-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2025-08-01T16:15:56.488Z","updated_at":"2025-08-01T16:15:58.471Z","avatar_url":"https://github.com/sudo-arash.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Classify Positive or Negative of Sentences\r\n\r\nThis project classifies sentences as either **positive** or **negative** using a simple neural network.\r\n\r\nThe model is trained using the [Sentiment Labelled Sentences Dataset](https://www.kaggle.com/datasets/marklvl/sentiment-labelled-sentences-data-set) from Kaggle, which includes thousands of labeled short sentences from sources like Amazon, Yelp, and IMDB.\r\n\r\n## Architecture\r\n\r\nThe neural network is composed of three key layers:\r\n\r\n* `featureInputLayer`: Accepts the bag-of-words representation of the sentence.\r\n* `fullyConnectedLayer(10) + reluLayer`: Extracts key patterns in sentence sentiment.\r\n* `fullyConnectedLayer(2) + softmaxLayer`: Outputs a probability distribution over two classes: positive or negative.\r\n\r\n## How to Use the Model?\r\n\r\n### In MATLAB (R2024b+ recommended)\r\n\r\n1. Load the pretrained model using:\r\n\r\n   ```matlab\r\n   load model.mat\r\n   ```\r\n2. Use the model with:\r\n\r\n   ```matlab\r\n   testData\r\n   ```\r\n\r\nYou might need to open the testData file and change several things there.\r\n\r\n### In Python (with TensorFlow)\r\n\r\n1. Ensure the following files are present:\r\n\r\n   * `predict.py`\r\n   * `vocab.txt`\r\n   * `classifysentences/` (folder containing `model.py` and `weights.h5`)\r\n2. Run:\r\n\r\n   ```bash\r\n   python predict.py\r\n   ```\r\n\r\nYou can modify `predict.py` to classify your own input sentence or batch of sentences.\r\n\r\n\r\n## License \u0026 Attribution\r\n\r\nThis project is **open source**. You are free to:\r\n\r\n* Modify it.\r\n* Train it with larger or custom datasets.\r\n\r\nHowever, **you are not allowed to sell** this project or any derivative without permission.\r\n\r\n**Credit is required** for:\r\n\r\n* This repository.\r\n* The original dataset author on [Kaggle](https://www.kaggle.com/datasets/marklvl/sentiment-labelled-sentences-data-set).\r\n\r\n\r\nLicensed under **Creative Commons Attribution-NonCommercial 4.0 (CC BY-NC 4.0)** in the name of Arash Amini the author of the project.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-arash%2Fsentence-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudo-arash%2Fsentence-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudo-arash%2Fsentence-classifier/lists"}