{"id":26451053,"url":"https://github.com/git4additi/hate-speech-detection","last_synced_at":"2026-05-18T08:32:03.846Z","repository":{"id":280628220,"uuid":"942628240","full_name":"git4additi/hate-speech-detection","owner":"git4additi","description":"A comparison of different machine learning models for hate speech detection. Trained on a twitter hate speech dataset with more than 25K records.","archived":false,"fork":false,"pushed_at":"2025-03-04T12:27:41.000Z","size":18703,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T16:40:43.114Z","etag":null,"topics":["bi-gru","data-science","decision-trees","hate-speech-detection","lstm","svm","tensorflow","twitter"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/git4additi.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":"2025-03-04T12:09:58.000Z","updated_at":"2025-03-04T12:33:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c7e1088-c653-402f-82ec-4c207cc5e09c","html_url":"https://github.com/git4additi/hate-speech-detection","commit_stats":null,"previous_names":["git4additi/hate-speech-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/git4additi/hate-speech-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git4additi%2Fhate-speech-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git4additi%2Fhate-speech-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git4additi%2Fhate-speech-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git4additi%2Fhate-speech-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git4additi","download_url":"https://codeload.github.com/git4additi/hate-speech-detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git4additi%2Fhate-speech-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33170831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"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":["bi-gru","data-science","decision-trees","hate-speech-detection","lstm","svm","tensorflow","twitter"],"created_at":"2025-03-18T16:31:28.085Z","updated_at":"2026-05-18T08:32:03.839Z","avatar_url":"https://github.com/git4additi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Model Hate Speech Detection System\n\nA comprehensive hate speech detection system implementing multiple machine learning and deep learning approaches to classify text into three categories: Hate Speech, Offensive Language, and Neither. The system compares performance across different models including SVM, Decision Trees, LSTM, Bi-LSTM, and Bi-GRU.\n\n## Use pre-trained models\n\n```python\nfrom tensorflow.keras.models import load_model\nimport pickle\nimport os\n\ndef load_pretrained_models(models_dir='trained-models'):\n    traditional_models = {}\n    dl_models = {}\n    \n    try:\n        print(\"Loading traditional models...\")\n        for model_type in [ModelType.SVM, ModelType.DECISION_TREE]:\n            model_name = model_type.value.lower()\n            with open(os.path.join(models_dir, f'{model_name}.pkl'), 'rb') as f:\n                traditional_models[model_type] = pickle.load(f)\n        \n        print(\"Loading deep learning models...\")\n        for model_type in [ModelType.LSTM, ModelType.BI_LSTM, ModelType.BI_GRU]:\n            model_name = model_type.value.lower()\n            model_path = os.path.join(models_dir, f'{model_name}.h5')\n            dl_models[model_type] = load_model(model_path)\n        \n        # Load preprocessor\n        print(\"Loading preprocessor...\")\n        with open(os.path.join(models_dir, 'preprocessor.pkl'), 'rb') as f:\n            preprocessor = pickle.load(f)\n        \n        return traditional_models, dl_models, preprocessor\n    \n    except Exception as e:\n        print(f\"Error loading models: {str(e)}\")\n        return None, None, None\n\n# Example usage\ntraditional_models, dl_models, preprocessor = load_pretrained_models()\n\n# Quick Tweet analysis\nanalyzer = TweetAnalyzer(preprocessor, traditional_models, dl_models)\nresult = analyzer.analyze_tweet('your offensive tweet')\n```\n\n\u003cbr /\u003e\n\n\u003e [!NOTE]  \n\u003e bi-gru and bi-lstm models are not available in the pre-trained directory because of GitHub file size limitations.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit4additi%2Fhate-speech-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit4additi%2Fhate-speech-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit4additi%2Fhate-speech-detection/lists"}