{"id":29194754,"url":"https://github.com/paradite/reddit-post-classifier","last_synced_at":"2025-07-02T04:38:04.695Z","repository":{"id":285913304,"uuid":"959728740","full_name":"paradite/reddit-post-classifier","owner":"paradite","description":"A simple classifier for Reddit posts.","archived":false,"fork":false,"pushed_at":"2025-06-23T09:40:37.000Z","size":1025,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T10:37:52.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tracker.16x.engineer/","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/paradite.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-04-03T08:58:46.000Z","updated_at":"2025-06-23T09:40:41.000Z","dependencies_parsed_at":"2025-04-03T10:32:41.081Z","dependency_job_id":"b9901b2c-394d-4edd-85a3-29870940424c","html_url":"https://github.com/paradite/reddit-post-classifier","commit_stats":null,"previous_names":["paradite/reddit-post-classifier"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paradite/reddit-post-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradite%2Freddit-post-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradite%2Freddit-post-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradite%2Freddit-post-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradite%2Freddit-post-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paradite","download_url":"https://codeload.github.com/paradite/reddit-post-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paradite%2Freddit-post-classifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263076973,"owners_count":23410164,"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","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-07-02T04:38:03.172Z","updated_at":"2025-07-02T04:38:04.670Z","avatar_url":"https://github.com/paradite.png","language":"Python","readme":"# Reddit Post Classifier\n\nThis project is a simple classifier for Reddit posts. It uses pre-trained models to classify posts as relevant or irrelevant.\n\nCreated by [16x Tracker](https://tracker.16x.engineer/)\n\n![screenshot](screenshots/screenshot.png)\n\n## System Requirements\n\n- Minimum 2GB RAM (4GB recommended)\n- Docker and Docker Compose installed\n- About 1GB disk space for the models and dependencies\n\n## Sample Results\n\n### Apr 5 run\n\nPre-processing\n\n```\nTotal entries processed: 9353\nUnique entries: 4549\nDuplicate entries: 1191\nF5Bot filtered entries: 8\nTeam ID filtered entries (not team 1): 10359\n\nStatus breakdown:\nRELEVANT/REPLIED: 241\nIGNORED: 4246\nNEW: 3\nCONTENT_REMOVED: 59\n```\n\nModel Results\n\n```\n               precision    recall  f1-score   support\n\n           0       0.98      0.95      0.96      1437\n           1       0.25      0.50      0.33        50\n\n    accuracy                           0.93      1487\n   macro avg       0.62      0.72      0.65      1487\nweighted avg       0.96      0.93      0.94      1487\n```\n\n### Apr 18 run\n\nPre-processing\n\n```\nTotal entries processed: 8473\nUnique entries: 4258\nDuplicate entries: 1174\nF5Bot filtered entries: 8\nTeam ID filtered entries (not team 1): 0\n\nStatus breakdown:\nRELEVANT/REPLIED: 274\nIGNORED: 3828\nNEW: 86\nCONTENT_REMOVED: 70\n```\n\nModel Results\n\n```\n              precision    recall  f1-score   support\n\n           0       0.97      0.94      0.95       766\n           1       0.40      0.53      0.46        55\n\n    accuracy                           0.92       821\n   macro avg       0.68      0.74      0.71       821\nweighted avg       0.93      0.92      0.92       821\n```\n\n### Apr 19 run\n\nPre-processing\n\n```\nTotal entries processed: 8288\nUnique entries: 4076\nDuplicate entries: 1171\nF5Bot filtered entries: 0\nTeam ID filtered entries (not team 1): 0\nTimestamp filtered entries (older than 90 days): 193\n\nStatus breakdown:\nRELEVANT/REPLIED: 123\nIGNORED: 3828\nNEW: 86\nCONTENT_REMOVED: 39\n```\n\nModel Results\n\ndistilbert-base-uncased\n\n```\n              precision    recall  f1-score   support\n\n           0       0.97      0.98      0.97       766\n           1       0.05      0.04      0.05        25\n\n    accuracy                           0.95       791\n   macro avg       0.51      0.51      0.51       791\nweighted avg       0.94      0.95      0.94       791\n```\n\nroberta-base\n\n```\n              precision    recall  f1-score   support\n\n           0       0.97      0.98      0.98       766\n           1       0.22      0.16      0.19        25\n\n    accuracy                           0.96       791\n   macro avg       0.60      0.57      0.58       791\nweighted avg       0.95      0.96      0.95       791\n```\n\n### Regressor Model\n\nThe regressor model is a simple linear regression model that uses the pre-trained roberta-base model to predict the relevance score of a post.\n\n```\nRegressor Test Results Summary:\nTotal samples tested: 60\nOverall accuracy: 80.00%\nIrrelevant samples accuracy: 73.33% (22/30)\nRelevant samples accuracy: 86.67% (26/30)\n\nClassification Metrics:\nPrecision: 0.7647\nRecall: 0.8667\nF1 Score: 0.8125\n\nRegression Metrics:\nMean Squared Error (MSE): 0.4112\nR-squared (R²): -0.6447\n\nConfusion Matrix:\nTrue Positives: 26\nFalse Positives: 8\nTrue Negatives: 22\nFalse Negatives: 4\n```\n\n### URL Regressor Model\n\nThe URL regressor model is a simple linear regression model that uses the pre-trained roberta-base model to predict the relevance score of a post. URL is added as prefix to the post content. The data used is from April 2025.\n\nModel weights: `best_url_regressor_run1_epoch_5.pt`\nOptimal threshold: 0.1500\n\nURL prefix logic sample:\n\n```py\noutput_path = 'sample_url_prefix.txt'\nurl = 'https://www.google.com'\ncontent = 'This is a test post'\n\nwith open(output_path, 'w', encoding='utf-8') as f:\n   if url:\n      f.write(f\"{url}\\n\\n\")\n   f.write(content)\n```\n\nResults:\n\n```\n================================================================================\nREGRESSOR MODEL TEST RESULTS - 2025-05-10 16:37:48\n================================================================================\n\nOptimal threshold: 0.1500\n\n================================================================================\nTESTING 30 RANDOM IRRELEVANT SAMPLES\n================================================================================\n\n================================================================================\nSUMMARY\n================================================================================\n\nTotal samples tested: 60\nOverall accuracy: 81.67%\nIrrelevant samples accuracy: 73.33% (22/30)\nRelevant samples accuracy: 90.00% (27/30)\n\nClassification Metrics:\nPrecision: 0.7714\nRecall: 0.9000\nF1 Score: 0.8308\n\nRegression Metrics:\nMean Squared Error (MSE): 0.2690\nR-squared (R²): -0.0762\n\nConfusion Matrix:\nTrue Positives: 27\nFalse Positives: 8\nTrue Negatives: 22\nFalse Negatives: 3\n```\n\n## Running the API Server\n\n### Using Docker Compose (Recommended)\n\nThe easiest way to run the service is using Docker Compose. The service will run in a container named `reddit-classifier-api`:\n\n```bash\n# pull latest changes from repo, rebuild the image and start the service\ngit pull \u0026\u0026 docker compose up --build -d\n\n# view logs\ndocker compose logs -f\n\n# Stop the service\ndocker compose down\n\n# view container logs directly (using container name)\ndocker logs -f reddit-classifier-api\n```\n\n### Using Docker\n\nBuild the Docker image:\n\n```bash\ndocker build -t reddit-post-classifier .\n```\n\nRun the container:\n\n```bash\ndocker run -p 9092:9092 reddit-post-classifier\n```\n\n### Without Docker\n\nRun the API server directly:\n\n```bash\npython api-server.py\n```\n\n## API Documentation\n\nSee [API_DOC.md](API_DOC.md) for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadite%2Freddit-post-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparadite%2Freddit-post-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparadite%2Freddit-post-classifier/lists"}